feat(webui): Remove limit from guided UI and set default limit in guided queries to 1000 results.#1398
Conversation
WalkthroughRemoved user-configurable LIMIT from Presto guided search. Deleted Limit UI component and related state fields/setters, updated CSS grid classes, adjusted GuidedControls to omit Limit, refactored RunButton to use individual selectors, and hardcoded a DEFAULT_SEARCH_LIMIT (1000) in query construction. Minor whitespace/formatting tweaks elsewhere. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant UI as GuidedControls UI
participant RB as GuidedRunButton
participant QS as buildPrestoGuidedQueries
participant S as Presto Backend
U->>UI: Provide select/from/where/timestampKey/order
U->>RB: Click Run
RB->>QS: Build queries with state values
note over QS: Apply DEFAULT_SEARCH_LIMIT (1000)<br/>No user-provided limit
QS-->>RB: searchQueryString (with LIMIT 1000)
RB->>S: Submit query
S-->>RB: Results
RB-->>U: Display results
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/RunButton/GuidedRunButton.tsx (1)
88-88: Coding guideline violation: Use explicit comparison.The negation operator
!isQueryReadyviolates the coding guideline. Usefalse === isQueryReadyinstead.As per coding guidelines.
Apply this diff:
- disabled={!isQueryReady || + disabled={false === isQueryReady || searchUiState === SEARCH_UI_STATE.QUERY_ID_PENDING}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (7)
components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/Limit.tsx(0 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/index.module.css(2 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/index.tsx(0 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/RunButton/GuidedRunButton.tsx(2 hunks)components/webui/client/src/pages/SearchPage/SearchState/Presto/index.tsx(0 hunks)components/webui/client/src/sql-parser/index.ts(2 hunks)components/webui/client/src/sql-parser/typings.ts(1 hunks)
💤 Files with no reviewable changes (3)
- components/webui/client/src/pages/SearchPage/SearchState/Presto/index.tsx
- components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/Limit.tsx
- components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/index.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}
⚙️ CodeRabbit configuration file
- Prefer
false == <expression>rather than!<expression>.
Files:
components/webui/client/src/sql-parser/typings.tscomponents/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/RunButton/GuidedRunButton.tsxcomponents/webui/client/src/sql-parser/index.ts
🧬 Code graph analysis (1)
components/webui/client/src/sql-parser/index.ts (1)
components/webui/client/src/sql-parser/typings.ts (1)
DEFAULT_SEARCH_LIMIT(30-30)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: conventional-commits
- GitHub Check: package-image
🔇 Additional comments (8)
components/webui/client/src/sql-parser/typings.ts (2)
21-24: LGTM! Well-documented default limit constant.The constant definition is clear, well-documented, and the value of 1000 aligns with the PR objectives to provide a sensible default for search queries.
30-30: LGTM! Proper export of the constant.The export statement correctly makes the constant available for use in other modules.
components/webui/client/src/sql-parser/index.ts (2)
14-14: LGTM! Correct import of the default limit constant.The import properly brings in the
DEFAULT_SEARCH_LIMITconstant for use in the query building logic.
118-120: LGTM! Default limit logic is correctly implemented.The else clause properly applies the default limit of 1000 when no explicit limit is provided. This ensures all search queries have a bounded result set, which is a sensible default behaviour.
components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/RunButton/GuidedRunButton.tsx (3)
36-36: LGTM: Correct usage of comparison.The comparison follows the coding guideline by using
false === isQueryReadyrather than!isQueryReady.As per coding guidelines.
41-41: Verify the intentional use ofgetState()for fresh state values.Fetching
whereandorderByviagetState()at click time ensures the latest values are used, rather than capturing them at render time. Confirm this behaviour is intentional, as it differs from the pattern used forselect,from, andtimestampKey, which are captured via selectors and included in the dependency array.
58-66: Default limit of 1000 is already applied in buildSearchQuery (index.ts:119). No further action required.components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/index.module.css (1)
18-21: New .timestampKey placement looks goodSpan 1 and flex container are consistent with the grid.
hoophalab
left a comment
There was a problem hiding this comment.
lgtm. Only one nitpick.
Validations: limit input is removed and the results are limited to 1000
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
components/webui/client/src/pages/SearchPage/SearchControls/Presto/presto-guided-search-requests.ts(3 hunks)components/webui/client/src/sql-parser/typings.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}
⚙️ CodeRabbit configuration file
- Prefer
false == <expression>rather than!<expression>.
Files:
components/webui/client/src/pages/SearchPage/SearchControls/Presto/presto-guided-search-requests.tscomponents/webui/client/src/sql-parser/typings.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: rust-checks (ubuntu-24.04)
- GitHub Check: rust-checks (ubuntu-22.04)
- GitHub Check: lint-check (ubuntu-24.04)
🔇 Additional comments (2)
components/webui/client/src/pages/SearchPage/SearchControls/Presto/presto-guided-search-requests.ts (2)
69-69: LGTM! State destructuring correctly updated.The removal of
limitfrom the destructured state aligns with the PR objective to remove the limit control from the guided UI.
88-88: LGTM! Default limit correctly hardcoded.The implementation now always includes a LIMIT clause with the default value of 1000, which aligns with the PR objectives. This is a behaviour change from the previous conditional inclusion, but it's intentional and was previously discussed in reviews. Based on learnings.
hoophalab
left a comment
There was a problem hiding this comment.
All good, except one more nitpick: There is one unintentionally added empty line.
Co-authored-by: hoophalab <200652805+hoophalab@users.noreply.github.com>
junhaoliao
left a comment
There was a problem hiding this comment.
deferring to @hoophalab 's review
…ded queries to 1000 results. (y-scope#1398)
Description
Removes limit, and reallocates space in grid to fill new empty space
Checklist
breaking change.
Validation performed
Ran query
Summary by CodeRabbit
Refactor
Style