refactor(new-webui): Add Nullable typing for cachedDataset to support null dataset option for clp-text.#1079
Conversation
…am in clp-text flavor.
WalkthroughThe changes update the handling of the Changes
Sequence Diagram(s)sequenceDiagram
participant UI
participant SearchState
participant QueryAPI
UI->>SearchState: Retrieve cachedDataset (Nullable<string>)
SearchState-->>UI: Returns null or string
UI->>UI: If cachedDataset is null, set URL param to ""
UI->>QueryAPI: submitExtractStreamJob({ dataset: cachedDataset || null })
QueryAPI-->>UI: Job submission response
sequenceDiagram
participant UI
participant QueryAPI
UI->>QueryAPI: submitExtractStreamJob({ dataset: dataset === undefined ? null : dataset })
QueryAPI-->>UI: Job submission response
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learningscomponents/webui/client/eslint.config.mjs (1)⏰ 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)
🔇 Additional comments (1)
✨ Finishing Touches
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. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@davemarco the I don’t have much context on WebUI, so feel free to point out anything that looks off or unusual in the code. Also, do you have any suggestions for the PR title? |
| const cachedDataset = useSearchStore((state) => state.cachedDataset); | ||
| const nullableCachedDataset = useSearchStore((state) => state.cachedDataset); | ||
| // eslint-disable-next-line no-warning-comments | ||
| // TODO: URL search parameters can't be null, so we need a way to |
There was a problem hiding this comment.
I think this change and the one in QueryStatus.ts make the code less readable. Do u think its possible to just omit the dataset in the path completely? Then in QueryStatus if parsedResult.dataset is undefined, we can submit null? If not i think we should close this PR.
|
okay i tested the latest version and looks good |
davemarco
left a comment
There was a problem hiding this comment.
small nit above but i approve
kirkrodrigues
left a comment
There was a problem hiding this comment.
Deferring to @davemarco's review.
For the PR title, how about:
refactor(new-webui): Add `Nullable` typing for `cachedDataset` to support null dataset option for clp-text.
- We've been using
new-webuifor all new-webui commits. For consistency, can we switch towebuiafter the release? - Switched the first "to" to "for" since it's slightly confusing to read "... to x ... to y ...".
- I think the backticks help to clarify what are symbols in the code.
- clp-text is a known name for the clp-text-flavored package, so I don't think we need the word "flavor".
Nullable typing for cachedDataset to support null dataset option for clp-text.
…port null dataset option for clp-text. (y-scope#1079)
Description
Currently, the WebUI client sends a
/query/extract-streamrequest with thedatasetfield set to an empty string"". This doesn't cause any issues sinceDbManagerignores thedatasetfield whenjobTypeisEXTRACT_IR.However, for consistency with other APIs, it's better to use
nullinstead.This PR updates the default value of
cachedDatasetand modifies the request logic accordingly.Checklist
breaking change.
Validation performed
Tested for both clp-text and clp-json:
Summary by CodeRabbit
Bug Fixes
Refactor