feat(webui): Add a progress bar to the Presto search page.#1206
Conversation
WalkthroughIntroduces a reusable pseudo-progress hook and integrates it into QueryInput and a new Presto-specific ProgressBar. Updates search state handling to treat PRESTO FINISHED as DONE. Removes legacy progress constants. Adds conditional ProgressBar rendering on the SearchPage when the PRESTO engine is active. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SearchControls (QueryInput)
participant SearchPage
participant ProgressBar (Presto)
participant useSearchStore
participant usePseudoProgress
participant PrestoEngine
User->>SearchControls (QueryInput): Submit query
SearchControls (QueryInput)->>useSearchStore: Dispatch QUERY_ID_PENDING
useSearchStore-->>SearchControls (QueryInput): searchUiState = PENDING
SearchControls (QueryInput)->>usePseudoProgress: start()
SearchPage->>ProgressBar (Presto): Render when engine=PRESTO
ProgressBar (Presto)->>useSearchStore: Read searchUiState
useSearchStore-->>ProgressBar (Presto): PENDING
ProgressBar (Presto)->>usePseudoProgress: start()
loop every 100ms
usePseudoProgress-->>SearchControls (QueryInput): progress += 5 (≤100)
usePseudoProgress-->>ProgressBar (Presto): progress += 5 (≤100)
end
PrestoEngine-->>useSearchStore: Signal FINISHED or RESP_DONE
useSearchStore-->>SearchPage: lastSignal updated
SearchPage->>useUpdateStateWithMetadata: Process lastSignal
useUpdateStateWithMetadata-->>useSearchStore: Set searchUiState = DONE
useSearchStore-->>SearchControls (QueryInput): searchUiState = DONE
useSearchStore-->>ProgressBar (Presto): searchUiState = DONE
SearchControls (QueryInput)->>usePseudoProgress: stop()
ProgressBar (Presto)->>usePseudoProgress: stop()
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15–20 minutes Possibly related PRs
Suggested reviewers
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
| switch (resultsMetadata.lastSignal) { | ||
| case SEARCH_SIGNAL.RESP_DONE: | ||
| case PRESTO_SEARCH_SIGNAL.FINISHED: | ||
| updateSearchUiState(SEARCH_UI_STATE.DONE); | ||
| break; | ||
| case PRESTO_SEARCH_SIGNAL.FAILED: |
There was a problem hiding this comment.
Is this enough for synchronizing presto signal with ui state? @davemarco
davemarco
left a comment
There was a problem hiding this comment.
Looks good stylistic changes.
| switch (resultsMetadata.lastSignal) { | ||
| case SEARCH_SIGNAL.RESP_DONE: | ||
| case PRESTO_SEARCH_SIGNAL.FINISHED: | ||
| updateSearchUiState(SEARCH_UI_STATE.DONE); | ||
| break; | ||
| case PRESTO_SEARCH_SIGNAL.FAILED: |
| const usePseudoProgress = (): { | ||
| progress: Nullable<number>; | ||
| start: () => void; | ||
| stop: () => void; | ||
| } => { | ||
| const [progress, setProgress] = useState<Nullable<number>>(null); |
There was a problem hiding this comment.
i put this file under SearchPage directly to avoid cross dependency -- does this look good?
There was a problem hiding this comment.
what about in here /home/davidmawk/clp/components/webui/client/src/pages/SearchPage/SearchState? I think this is also good since it relates to ui state, and i have other hooks in there? If you dont like that, maybe just put it in a hooks folder?, its in a top level directory right now and this file seems kind of random here
davemarco
left a comment
There was a problem hiding this comment.
small then i approve. Thanks for changes
| const usePseudoProgress = (): { | ||
| progress: Nullable<number>; | ||
| start: () => void; | ||
| stop: () => void; | ||
| } => { | ||
| const [progress, setProgress] = useState<Nullable<number>>(null); |
There was a problem hiding this comment.
what about in here /home/davidmawk/clp/components/webui/client/src/pages/SearchPage/SearchState? I think this is also good since it relates to ui state, and i have other hooks in there? If you dont like that, maybe just put it in a hooks folder?, its in a top level directory right now and this file seems kind of random here
| * | ||
| * @return | ||
| */ | ||
| const PageProgress = () => { |
There was a problem hiding this comment.
How do you renaming folder/component this just ProgessBar?
davemarco
left a comment
There was a problem hiding this comment.
Changes look good. Title is good
kirkrodrigues
left a comment
There was a problem hiding this comment.
Deferring to @davemarco's review.
Description
Checklist
breaking change.
Validation performed
Presto search
FINISHED, the progress bar is hidden and search button becomesRunagainCLP search
usePseudoSearchhook doesn't change the behavior of clp search progress bar.Summary by CodeRabbit