-
Notifications
You must be signed in to change notification settings - Fork 83
feat(webui): Replace FROM input on guided Presto UI with a dataset selector. #1314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughIntroduces a new DatasetSelect React component that fetches dataset names and manages selection state and UI disabling. Replaces prior inline logic by using DatasetSelect in the Dataset index wrapper and in the Presto GuidedControls From component, removing previous SqlInput usage. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant DatasetSelect
participant react-query as react-query
participant API as fetchDatasetNames
participant Store as Search Store
participant UI as AntD Select
User->>DatasetSelect: Open/Focus control
DatasetSelect->>react-query: useQuery("datasets")
react-query->>API: fetch dataset names
API-->>react-query: dataset list or error
react-query-->>DatasetSelect: onSuccess/onError
alt First load, no selection, data non-empty
DatasetSelect->>Store: setDataset(firstItem)
else Empty data
DatasetSelect->>UI: show warning message
DatasetSelect->>Store: setDataset(null)
else Error
DatasetSelect->>UI: show error message
end
Note over DatasetSelect,UI: Disable control when query state is pending/querying
User->>UI: Change selection
UI->>DatasetSelect: onChange(selected)
DatasetSelect->>Store: setDataset(selected)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 9
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
components/webui/client/src/pages/SearchPage/SearchControls/Dataset/DatasetSelect.tsx(1 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Dataset/index.tsx(2 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/From.tsx(2 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/Dataset/index.tsxcomponents/webui/client/src/pages/SearchPage/SearchControls/Dataset/DatasetSelect.tsxcomponents/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/From.tsx
🧬 Code graph analysis (1)
components/webui/client/src/pages/SearchPage/SearchControls/Dataset/DatasetSelect.tsx (2)
components/webui/client/src/pages/SearchPage/SearchControls/Dataset/sql.ts (1)
fetchDatasetNames(36-36)components/webui/client/src/pages/SearchPage/SearchState/typings.ts (1)
SEARCH_UI_STATE(31-31)
⏰ 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: package-image
- GitHub Check: lint-check (macos-15)
🔇 Additional comments (3)
components/webui/client/src/pages/SearchPage/SearchControls/Dataset/index.tsx (1)
3-3: Good extraction and reuse of DatasetSelect.Import path and encapsulation look correct.
components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/From.tsx (1)
2-2: LGTM on replacing SqlInput with DatasetSelect.Pathing and usage look correct.
components/webui/client/src/pages/SearchPage/SearchControls/Dataset/DatasetSelect.tsx (1)
1-71: Verify multiple mounts don’t cause duplicate toasts.Component now uses global message; confirm no duplicate toasts appear when DatasetSelect is mounted multiple times on the same screen (e.g. Dataset panel + Presto From) in the integrated UI. Automated search didn't locate usages in the repo — manual verification required.
components/webui/client/src/pages/SearchPage/SearchControls/Dataset/DatasetSelect.tsx
Show resolved
Hide resolved
components/webui/client/src/pages/SearchPage/SearchControls/Dataset/DatasetSelect.tsx
Show resolved
Hide resolved
components/webui/client/src/pages/SearchPage/SearchControls/Dataset/DatasetSelect.tsx
Show resolved
Hide resolved
components/webui/client/src/pages/SearchPage/SearchControls/Dataset/DatasetSelect.tsx
Show resolved
Hide resolved
components/webui/client/src/pages/SearchPage/SearchControls/Dataset/DatasetSelect.tsx
Show resolved
Hide resolved
components/webui/client/src/pages/SearchPage/SearchControls/Dataset/DatasetSelect.tsx
Show resolved
Hide resolved
components/webui/client/src/pages/SearchPage/SearchControls/Dataset/DatasetSelect.tsx
Show resolved
Hide resolved
components/webui/client/src/pages/SearchPage/SearchControls/Dataset/index.tsx
Show resolved
Hide resolved
components/webui/client/src/pages/SearchPage/SearchControls/Presto/GuidedControls/From.tsx
Show resolved
Hide resolved
hoophalab
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. This PR simply extracts the selector from the clp-s dataset selector. The old page looks the same as before. The guided sql looks good.
|
How about presto -> Presto |
junhaoliao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deferring to @hoophalab 's review
Description
Replaces editor with dataset selector
Checklist
breaking change.
Validation performed
renders selector
Summary by CodeRabbit
New Features
Refactor