Skip to content

feat(new-webui): Add a progress bar for search.#891

Merged
hoophalab merged 7 commits into
y-scope:mainfrom
hoophalab:search-progress
May 12, 2025
Merged

feat(new-webui): Add a progress bar for search.#891
hoophalab merged 7 commits into
y-scope:mainfrom
hoophalab:search-progress

Conversation

@hoophalab

@hoophalab hoophalab commented May 8, 2025

Copy link
Copy Markdown
Contributor

Description

  1. Add QueryBox component, which wraps an antd Input with a progress bar at the bottom.
  2. Replace Input in SearchControls with QueryBox.

Since server features are not merged yet, SearchControls defaults to hide the progress bar.

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

QueryBox looks ok.

As storybook isn't merged, check this branch to play with QueryBox in storybook.

Summary by CodeRabbit

  • New Features

    • Introduced a custom query input box with an integrated progress bar for enhanced user feedback in the log viewer web UI.
  • Style

    • Added new styles to support the appearance and layout of the query input and its progress bar.

@hoophalab hoophalab requested a review from a team as a code owner May 8, 2025 20:32
@coderabbitai

coderabbitai Bot commented May 8, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

A new QueryBox React component with a built-in progress bar was introduced, styled via a new CSS module. The SearchControls component was updated to use QueryBox instead of the Ant Design Input, passing a progress prop set to null. Additionally, JSDoc comments were enhanced for the Jobs component without affecting functionality.

Changes

File(s) Change Summary
components/log-viewer-webui/client/src/components/QueryBox/index.module.css Added a CSS module defining styles for the new QueryBox component, including progress bar styling.
components/log-viewer-webui/client/src/components/QueryBox/index.tsx Added a new QueryBox React component with progress bar support and its prop interface.
components/log-viewer-webui/client/src/pages/SearchPage/SearchControls/index.tsx Replaced Ant Design Input with the new QueryBox component and updated imports and props accordingly.
components/log-viewer-webui/client/src/pages/IngestPage/Jobs/index.tsx Updated JSDoc comments for the Jobs component to include parameter annotations without changing implementation.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SearchControls
    participant QueryBox
    participant AntdInput

    User->>SearchControls: Interact with search input
    SearchControls->>QueryBox: Render with value, onChange, progress=null
    QueryBox->>AntdInput: Render Input with passed props
    QueryBox-->>SearchControls: (Optional) Display progress bar if progress is set
Loading

Suggested reviewers

  • junhaoliao

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@hoophalab hoophalab requested review from davemarco and junhaoliao May 8, 2025 20:33

@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.

visualization looks good to me. i discussed with @hoophalab offline that we might not want to maintain the progress percentage visualization logic on our own. @hoophalab will quickly experiment integration with https://ant.design/components/progress for future extensibility. if it's hard to integrate, maintaining only an input box with simple progress display seems also reasonable to me. @davemarco what do you think?

coderabbitai[bot]

This comment was marked as outdated.

@hoophalab

Copy link
Copy Markdown
Contributor Author

visualization looks good to me. i discussed with @hoophalab offline that we might not want to maintain the progress percentage visualization logic on our own. @hoophalab will quickly experiment integration with https://ant.design/components/progress for future extensibility. if it's hard to integrate, maintaining only an input box with simple progress display seems also reasonable to me. @davemarco what do you think?

I integrated antd's Progress in the latest commit.

coderabbitai[bot]

This comment was marked as outdated.

@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.

thanks for getting it done quickly and it looks nice. i posted some stylish comments

Comment thread components/log-viewer-webui/client/src/components/QueryBox/index.module.css Outdated
Comment thread components/log-viewer-webui/client/src/components/QueryBox/index.module.css Outdated
Comment thread components/log-viewer-webui/client/src/components/QueryBox/index.module.css Outdated
Comment thread components/log-viewer-webui/client/src/components/QueryBox/index.tsx Outdated
Comment thread components/log-viewer-webui/client/src/components/QueryBox/index.tsx Outdated
Comment thread components/log-viewer-webui/client/src/components/QueryBox/index.tsx Outdated
Comment thread components/log-viewer-webui/client/src/components/QueryBox/index.tsx Outdated
Comment thread components/log-viewer-webui/client/src/components/QueryBox/index.tsx Outdated
coderabbitai[bot]

This comment was marked as outdated.

coderabbitai[bot]

This comment was marked as resolved.

@hoophalab

Copy link
Copy Markdown
Contributor Author

@junhaoliao ready for your final review

Comment thread components/log-viewer-webui/client/src/pages/IngestPage/Jobs/index.tsx Outdated
Comment thread components/log-viewer-webui/client/src/components/QueryBox/index.tsx Outdated
Comment thread components/log-viewer-webui/client/src/components/QueryBox/index.module.css Outdated
Comment thread components/log-viewer-webui/client/src/components/QueryBox/index.module.css Outdated

@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

♻️ Duplicate comments (3)
components/log-viewer-webui/client/src/components/QueryBox/index.module.css (1)

12-22: 🧹 Nitpick (assertive)

Consider moving CSS variable to root level.

The --antd-border-radius variable is defined within the .queryBoxWrapper class but would be more maintainable if defined at a higher level.

+:root {
+  --antd-border-radius: 8px;
+}

.queryBoxWrapper {
  /* Prevents the progress bar from obstructing the input box. */
  pointer-events: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  overflow: hidden;
  border-radius: var(--antd-border-radius);
-  --antd-border-radius: 8px;
}
components/log-viewer-webui/client/src/components/QueryBox/index.tsx (2)

15-22: 🧹 Nitpick (assertive)

Improve JSDoc return type documentation.

The JSDoc comment is missing a return type description.

 /**
  * Renders an Input with a progress bar.
  *
  * @param props
  * @param props.progress
  * @param props.rest
- * @return
+ * @return {JSX.Element} The rendered QueryBox component with input and progress bar
  */

23-42: 🧹 Nitpick (assertive)

Consider using dot notation for CSS modules.

While bracket notation works, dot notation is more common and concise for accessing CSS module classes.

    return (
-        <div className={styles["queryBox"]}>
-            <div className={styles["queryBoxPosition"]}>
+        <div className={styles.queryBox}>
+            <div className={styles.queryBoxPosition}>
                <Input {...rest}/>
-                <div className={styles["queryBoxWrapper"]}>
+                <div className={styles.queryBoxWrapper}>
                    <Progress
-                        className={styles["queryBoxProgress"] || ""}
+                        className={styles.queryBoxProgress}
                        percent={progress ?? 0}
                        showInfo={false}
                        size={"small"}
                        strokeLinecap={"butt"}
                        style={{display: null === progress ?
                            "none" :
                            "block"}}/>
                </div>
            </div>
        </div>
    );
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6d5604e and dcf03ef.

📒 Files selected for processing (3)
  • components/log-viewer-webui/client/src/components/QueryBox/index.module.css (1 hunks)
  • components/log-viewer-webui/client/src/components/QueryBox/index.tsx (1 hunks)
  • components/log-viewer-webui/client/src/pages/IngestPage/Jobs/index.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}`: - Prefer `false == ` rather than `!`.

**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}: - Prefer false == <expression> rather than !<expression>.

  • components/log-viewer-webui/client/src/pages/IngestPage/Jobs/index.tsx
  • components/log-viewer-webui/client/src/components/QueryBox/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: lint-check (ubuntu-latest)
🔇 Additional comments (5)
components/log-viewer-webui/client/src/pages/IngestPage/Jobs/index.tsx (1)

79-80: JSDoc documentation improved with parameter details.

The JSDoc comment has been enhanced with proper parameter documentation, which improves code readability and IDE autocompletion support.

components/log-viewer-webui/client/src/components/QueryBox/index.module.css (3)

1-3: Base styling for QueryBox looks good.

The width styling provides appropriate flexibility for the component to adapt to its container.


5-10: Appropriate positioning context for absolute elements.

The positioning context is correctly set up with a descriptive comment explaining its purpose.


24-27: Progress bar positioning looks good.

The absolute positioning of the progress bar at the bottom of the container is appropriate for the UI design.

components/log-viewer-webui/client/src/components/QueryBox/index.tsx (1)

10-13: Well-documented prop interface with clear comments.

The QueryBoxProps interface properly extends InputProps and includes a descriptive JSDoc comment for the progress property.

Comment thread components/log-viewer-webui/client/src/components/QueryBox/index.module.css Outdated
…ex.module.css

Co-authored-by: Junhao Liao <junhao@junhao.ca>

@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: 2

♻️ Duplicate comments (1)
components/log-viewer-webui/client/src/components/QueryBox/index.module.css (1)

20-21: Consider centralizing the CSS variable.

Defining --antd-border-radius locally limits reuse. You can move it to :root for consistency across components:

+:root {
+  --antd-border-radius: 8px;
+}
 
 .queryBoxWrapper {
-  border-radius: var(--antd-border-radius);
-  --antd-border-radius: 8px;
+  border-radius: var(--antd-border-radius);
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dcf03ef and c926e25.

📒 Files selected for processing (1)
  • components/log-viewer-webui/client/src/components/QueryBox/index.module.css (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: lint-check (ubuntu-latest)
🔇 Additional comments (2)
components/log-viewer-webui/client/src/components/QueryBox/index.module.css (2)

1-3: Approve .queryBox container styling.

The block correctly sets full width for the input wrapper and follows the module’s naming conventions.


5-10: Approve positioning context in .queryBoxPosition.

Using position: relative with full width/height and a clear doc comment establishes the necessary stacking context for absolutely-positioned children.

Comment on lines +24 to +27
.queryBoxProgress {
position: absolute;
bottom: -8px;
}

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.

🧹 Nitpick (assertive)

Ensure the progress bar spans full width.

By default, an absolutely positioned element without left and explicit width may not fill its container. Consider adding:

 .queryBoxProgress {
   position: absolute;
   bottom: -8px;
+  left: 0;
+  width: 100%;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.queryBoxProgress {
position: absolute;
bottom: -8px;
}
.queryBoxProgress {
position: absolute;
bottom: -8px;
left: 0;
width: 100%;
}

Comment on lines +12 to +19
.queryBoxWrapper {
/* Prevents the progress bar from obstructing the input box. */
pointer-events: none;
width: 100%;
height: 100%;
position: absolute;
top: 0;
overflow: hidden;

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.

🛠️ Refactor suggestion

Ensure the wrapper covers the full input area.

Without a left: 0, the absolutely positioned .queryBoxWrapper may not align correctly over the underlying input. Please add left: 0 to guarantee full coverage:

 .queryBoxWrapper {
   /* Prevents the progress bar from obstructing the input box. */
   pointer-events: none;
   width: 100%;
   height: 100%;
   position: absolute;
   top: 0;
+  left: 0;
   overflow: hidden;
   border-radius: var(--antd-border-radius);
   --antd-border-radius: 8px;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.queryBoxWrapper {
/* Prevents the progress bar from obstructing the input box. */
pointer-events: none;
width: 100%;
height: 100%;
position: absolute;
top: 0;
overflow: hidden;
.queryBoxWrapper {
/* Prevents the progress bar from obstructing the input box. */
pointer-events: none;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
overflow: hidden;
border-radius: var(--antd-border-radius);
--antd-border-radius: 8px;
}

@hoophalab hoophalab merged commit 8eeea1a into y-scope:main May 12, 2025
5 checks passed
@hoophalab hoophalab deleted the search-progress branch July 8, 2025 19:42
junhaoliao pushed a commit to junhaoliao/clp that referenced this pull request May 17, 2026
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.

2 participants