-
Notifications
You must be signed in to change notification settings - Fork 82
feat(webui): Add a progress bar to the Presto search page. #1206
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this enough for synchronizing presto signal with ui state? @davemarco
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.
yes i think good
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.
Looks good stylistic changes.
components/webui/client/src/pages/SearchPage/PrestoProgress/index.module.css
Outdated
Show resolved
Hide resolved
components/webui/client/src/pages/SearchPage/SearchControls/QueryInput/index.tsx
Show resolved
Hide resolved
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes i think good
const usePseudoProgress = (): { | ||
progress: Nullable<number>; | ||
start: () => void; | ||
stop: () => void; | ||
} => { | ||
const [progress, setProgress] = useState<Nullable<number>>(null); |
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.
i put this file under SearchPage directly to avoid cross dependency -- does this look good?
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.
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
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you renaming folder/component this just ProgessBar?
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.
Changes look good. Title is good
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 @davemarco's review.
Description
Checklist
breaking change.
Validation performed
Presto search
FINISHED
, the progress bar is hidden and search button becomesRun
againCLP search
usePseudoSearch
hook doesn't change the behavior of clp search progress bar.Summary by CodeRabbit