refactor(webui): Restructure directory hierarchy to better separate Presto Freeform and Guided components; Rename Presto SQL interface button component.#1762
Conversation
WalkthroughThis PR reorganizes Presto search control components into Freeform and Guided subdirectories, renames Changes
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (15)
components/webui/client/src/pages/SearchPage/SearchControls/Presto/Freeform/FreeformControls.tsx(2 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Presto/Freeform/SqlQueryInput/index.tsx(1 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Presto/Freeform/presto-search-requests.ts(1 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/From.tsx(1 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/OrderBy.tsx(1 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/Select.tsx(1 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/Where.tsx(1 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/index.tsx(2 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/presto-guided-search-requests.ts(1 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlInterfaceSelector/index.tsx(2 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/CancelButton/index.tsx(1 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/RunButton/FreeformRunButton.tsx(1 hunks)components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/RunButton/GuidedRunButton.tsx(1 hunks)components/webui/client/src/pages/SearchPage/SearchControls/index.tsx(1 hunks)components/webui/client/src/pages/SearchPage/SearchResults/SearchResultsTimeline/Presto/PrestoResultsTimeline.tsx(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/SqlSearchButton/CancelButton/index.tsxcomponents/webui/client/src/pages/SearchPage/SearchControls/Presto/Freeform/SqlQueryInput/index.tsxcomponents/webui/client/src/pages/SearchPage/SearchResults/SearchResultsTimeline/Presto/PrestoResultsTimeline.tsxcomponents/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/Select.tsxcomponents/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/Where.tsxcomponents/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/presto-guided-search-requests.tscomponents/webui/client/src/pages/SearchPage/SearchControls/Presto/Freeform/FreeformControls.tsxcomponents/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/RunButton/GuidedRunButton.tsxcomponents/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/From.tsxcomponents/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/index.tsxcomponents/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/RunButton/FreeformRunButton.tsxcomponents/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlInterfaceSelector/index.tsxcomponents/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/OrderBy.tsxcomponents/webui/client/src/pages/SearchPage/SearchControls/index.tsxcomponents/webui/client/src/pages/SearchPage/SearchControls/Presto/Freeform/presto-search-requests.ts
🧠 Learnings (1)
📚 Learning: 2024-11-21T15:51:33.203Z
Learnt from: junhaoliao
Repo: y-scope/clp PR: 596
File: components/log-viewer-webui/client/src/api/query.js:16-23
Timestamp: 2024-11-21T15:51:33.203Z
Learning: In `components/log-viewer-webui/client/src/api/query.js`, the `ExtractJsonResp` type definition is accurate as-is and does not require modification. When suggesting changes to type definitions, ensure they align with the server-side definitions, referencing the source code if necessary.
Applied to files:
components/webui/client/src/pages/SearchPage/SearchControls/Presto/Freeform/SqlQueryInput/index.tsxcomponents/webui/client/src/pages/SearchPage/SearchResults/SearchResultsTimeline/Presto/PrestoResultsTimeline.tsxcomponents/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/Where.tsx
⏰ 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). (5)
- GitHub Check: package-image
- GitHub Check: build (macos-15)
- GitHub Check: build (ubuntu-24.04)
- GitHub Check: lint-check (macos-15)
- GitHub Check: lint-check (ubuntu-24.04)
🔇 Additional comments (16)
components/webui/client/src/pages/SearchPage/SearchControls/Presto/Freeform/SqlQueryInput/index.tsx (1)
10-12: Import paths correctly updated for restructured directory layout.The three import paths have been accurately adjusted to reflect the new file location within the Freeform subdirectory. All relative paths resolve to the correct modules (SqlEditor, SearchState index, and SearchState typings). All imported symbols are used throughout the component.
components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/From.tsx (1)
1-2: Import path updates look consistent with the new Guided layoutThe updated paths for
InputLabelandDatasetSelectmatch the deeper Guided/Freeform structure and don’t change runtime behaviour.components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/RunButton/FreeformRunButton.tsx (1)
11-11: Freeform search request import now correctly scoped underFreeformUpdating
handlePrestoQuerySubmitto../../Freeform/presto-search-requestsmatches the new Freeform directory structure without changing button behaviour.components/webui/client/src/pages/SearchPage/SearchResults/SearchResultsTimeline/Presto/PrestoResultsTimeline.tsx (1)
11-13: Guided search request imports aligned withGuidedsubfolderThe import of
buildPrestoGuidedQueriesandhandlePrestoGuidedQuerySubmitfromPresto/Guided/presto-guided-search-requestsmatches the new Guided structure and preserves existing zoom/re‑query behaviour.components/webui/client/src/pages/SearchPage/SearchControls/index.tsx (1)
7-8: Presto control imports now correctly reflect Freeform/Guided splitPointing
FreeformControlsandGuidedControlsto./Presto/Freeform/FreeformControlsand./Presto/Guided/GuidedControlscleanly matches the new directory structure, with no change to which controls render under each engine/interface combination.components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/RunButton/GuidedRunButton.tsx (1)
20-22: Guided run handlers now imported fromGuidedmodule as expectedUpdating the import to
../../Guided/presto-guided-search-requestskeeps the Guided run button wired to the guided search utilities while aligning with the new folder layout; execution flow and error handling remain the same.components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/OrderBy.tsx (1)
1-6: Order‑by control imports correctly updated for deeper Guided nestingThe revised paths for shared components, SQL parser utilities, and search state hooks reflect the new directory depth while preserving the existing validation and disablement behaviour of the ORDER BY field.
components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/CancelButton/index.tsx (1)
12-13: Cancel handlers now clearly split between Freeform and Guided modulesRouting
handlePrestoQueryCancelthrough the Freeform module andhandlePrestoGuidedQueryCancelthrough the Guided module matches the interface split and keeps the existing conditional cancel behaviour intact.components/webui/client/src/pages/SearchPage/SearchControls/Presto/Freeform/presto-search-requests.ts (1)
10-14: LGTM! Import paths correctly updated for new directory structure.The import paths have been properly adjusted to reflect the file's new location in the Freeform subdirectory. All relative paths are consistent with the restructuring.
components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/Select.tsx (1)
1-6: LGTM! Import paths correctly updated.The import paths have been properly adjusted to reflect the reorganized directory structure. The component logic remains unchanged.
components/webui/client/src/pages/SearchPage/SearchControls/Presto/Freeform/FreeformControls.tsx (2)
1-4: LGTM! Import paths and component rename applied correctly.The import paths reflect the new directory structure, and the SqlInterfaceButton → SqlInterfaceSelector rename has been applied consistently.
16-16: LGTM! Component usage updated consistently with the rename.The JSX correctly uses the renamed SqlInterfaceSelector component, matching the updated import.
components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/Where.tsx (1)
1-6: LGTM! Import paths correctly updated.The import paths have been properly adjusted to reflect the reorganized directory structure, consistent with sibling components in GuidedControls.
components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/index.tsx (2)
1-6: LGTM! Import paths and component rename applied correctly.The import paths correctly reflect the reorganized structure, and the SqlInterfaceButton → SqlInterfaceSelector rename has been applied consistently.
27-27: LGTM! Component usage updated consistently.The JSX correctly uses the renamed SqlInterfaceSelector component, matching the updated import.
components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/presto-guided-search-requests.ts (1)
7-16: LGTM! Import paths correctly updated for new directory structure.The import paths have been properly adjusted to reflect the file's new location in the Guided subdirectory. All relative paths are consistent with the restructuring.
junhaoliao
left a comment
There was a problem hiding this comment.
deferring to @hoophalab 's review
…resto Freeform and Guided components; Rename Presto SQL interface button component. (y-scope#1762)
…resto Freeform and Guided components; Rename Presto SQL interface button component. (y-scope#1762)
…resto Freeform and Guided components; Rename Presto SQL interface button component. (y-scope#1762)
Description
Presto search controls directory was bit cluttered. This PR moves freeform and guided components into their own directories. It also renames the sql interface interface selector since this was missed when we actually swapped the antd component.
Checklist
breaking change.
Validation performed
Presto UI loads in dev mode
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.