Skip to content

refactor(webui): Restructure directory hierarchy to better separate Presto Freeform and Guided components; Rename Presto SQL interface button component.#1762

Merged
davemarco merged 10 commits into
y-scope:mainfrom
davemarco:freeform_hoist
Dec 18, 2025

Conversation

@davemarco

@davemarco davemarco commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

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

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

Presto UI loads in dev mode

Summary by CodeRabbit

  • Refactor
    • Reorganized search interface components and restructured the folder hierarchy for Freeform and Guided search controls. Updated component relationships, module paths, and internal dependencies throughout the search system to align with the new directory organization.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This PR reorganizes Presto search control components into Freeform and Guided subdirectories, renames SqlInterfaceButton to SqlInterfaceSelector, and updates all import paths throughout the codebase to reflect the new folder structure.

Changes

Cohort / File(s) Summary
Component Rename: SqlInterfaceButton → SqlInterfaceSelector
components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlInterfaceSelector/index.tsx
Function renamed from SqlInterfaceButton to SqlInterfaceSelector; JSDoc updated; internal import paths reversed to align with new Freeform/Guided folder structure
Freeform Controls
components/webui/client/src/pages/SearchPage/SearchControls/Presto/Freeform/FreeformControls.tsx, components/webui/client/src/pages/SearchPage/SearchControls/Presto/Freeform/SqlQueryInput/index.tsx, components/webui/client/src/pages/SearchPage/SearchControls/Presto/Freeform/presto-search-requests.ts
Replaced SqlInterfaceButton with SqlInterfaceSelector in FreeformControls; updated all import paths to reflect deeper folder structure (2–3 levels up)
Guided Controls
components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/From.tsx, components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/OrderBy.tsx, components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/Select.tsx, components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/Where.tsx, components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/index.tsx, components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/presto-guided-search-requests.ts
Replaced SqlInterfaceButton with SqlInterfaceSelector in GuidedControls; updated import paths for InputLabel, SqlInput, validation functions, and state modules to reflect deeper folder structure (5–6 levels up)
SqlSearchButton Subfolders
components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/CancelButton/index.tsx, components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/RunButton/FreeformRunButton.tsx, components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/RunButton/GuidedRunButton.tsx
Updated import paths to point to Freeform/presto-search-requests and Guided/presto-guided-search-requests subdirectories
Top-Level SearchControls and Results Timeline
components/webui/client/src/pages/SearchPage/SearchControls/index.tsx, components/webui/client/src/pages/SearchPage/SearchResults/SearchResultsTimeline/Presto/PrestoResultsTimeline.tsx
Updated import paths for FreeformControls and GuidedControls to point to new subdirectories; updated buildPrestoGuidedQueries and handlePrestoGuidedQuerySubmit imports to Guided/presto-guided-search-requests

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Import path verification: Carefully verify all relative path changes (particularly the increased ../ segments) resolve correctly to their intended modules across 15 files
  • Component rename consistency: Confirm SqlInterfaceSelector is imported and used correctly everywhere it was previously SqlInterfaceButton
  • Folder structure assumptions: Ensure the new Freeform/Guided subdirectory structure matches the actual file organization in the repository

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the two main changes: restructuring directory hierarchy to separate Freeform and Guided components, and renaming the SQL interface button component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@davemarco davemarco requested a review from hoophalab December 10, 2025 17:42
@davemarco davemarco marked this pull request as ready for review December 10, 2025 17:42
@davemarco davemarco requested a review from a team as a code owner December 10, 2025 17:42
@davemarco davemarco changed the title refactor(webui): Restructure directory hierarchy to better separate Presto Freeform and guided components; Rename Presto SQL interface button component. refactor(webui): Restructure directory hierarchy to better separate Presto Freeform and Guided components; Rename Presto SQL interface button component. Dec 10, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 53b8bf0 and 48ba5cd.

📒 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.tsx
  • components/webui/client/src/pages/SearchPage/SearchControls/Presto/Freeform/SqlQueryInput/index.tsx
  • components/webui/client/src/pages/SearchPage/SearchResults/SearchResultsTimeline/Presto/PrestoResultsTimeline.tsx
  • components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/Select.tsx
  • components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/Where.tsx
  • components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/presto-guided-search-requests.ts
  • components/webui/client/src/pages/SearchPage/SearchControls/Presto/Freeform/FreeformControls.tsx
  • components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/RunButton/GuidedRunButton.tsx
  • components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/From.tsx
  • components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/index.tsx
  • components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlSearchButton/RunButton/FreeformRunButton.tsx
  • components/webui/client/src/pages/SearchPage/SearchControls/Presto/SqlInterfaceSelector/index.tsx
  • components/webui/client/src/pages/SearchPage/SearchControls/Presto/Guided/GuidedControls/OrderBy.tsx
  • components/webui/client/src/pages/SearchPage/SearchControls/index.tsx
  • components/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.tsx
  • components/webui/client/src/pages/SearchPage/SearchResults/SearchResultsTimeline/Presto/PrestoResultsTimeline.tsx
  • components/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 layout

The updated paths for InputLabel and DatasetSelect match 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 under Freeform

Updating handlePrestoQuerySubmit to ../../Freeform/presto-search-requests matches 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 with Guided subfolder

The import of buildPrestoGuidedQueries and handlePrestoGuidedQuerySubmit from Presto/Guided/presto-guided-search-requests matches 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 split

Pointing FreeformControls and GuidedControls to ./Presto/Freeform/FreeformControls and ./Presto/Guided/GuidedControls cleanly 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 from Guided module as expected

Updating the import to ../../Guided/presto-guided-search-requests keeps 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 nesting

The 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 modules

Routing handlePrestoQueryCancel through the Freeform module and handlePrestoGuidedQueryCancel through 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.

@hoophalab hoophalab requested a review from junhaoliao December 15, 2025 17:30

@junhaoliao junhaoliao left a comment

Copy link
Copy Markdown
Member

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

@davemarco davemarco merged commit 9e9a86b into y-scope:main Dec 18, 2025
20 checks passed
davidlion pushed a commit to davidlion/clp that referenced this pull request Jan 17, 2026
…resto Freeform and Guided components; Rename Presto SQL interface button component. (y-scope#1762)
junhaoliao pushed a commit to junhaoliao/clp that referenced this pull request May 17, 2026
…resto Freeform and Guided components; Rename Presto SQL interface button component. (y-scope#1762)
junhaoliao pushed a commit to junhaoliao/clp that referenced this pull request May 17, 2026
…resto Freeform and Guided components; Rename Presto SQL interface button component. (y-scope#1762)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants