Skip to content

fix(web): UI polish for studio grid and research search box#374

Closed
Li-Suqi wants to merge 0 commit intojerry609:devfrom
Li-Suqi:dev
Closed

fix(web): UI polish for studio grid and research search box#374
Li-Suqi wants to merge 0 commit intojerry609:devfrom
Li-Suqi:dev

Conversation

@Li-Suqi
Copy link
Collaborator

@Li-Suqi Li-Suqi commented Mar 12, 2026

Summary

This PR fixes two UI issues in the web app:

  • DeepCode Studio All Papers grid showed unwanted gray background and inconsistent borders when the number of cards was not a multiple of 4.
  • Research search box showed overlapping rounded corners from nested containers.

What Changed

  • Updated web/src/components/studio/PaperGallery.tsx

  • Changed grid background to white.

  • Removed the outer "All Papers" frame.

  • Switched to per-card borders (no card gap).

  • Adjusted border drawing logic so touching card edges stay single-width (no thick double border).

  • Updated web/src/components/research/SearchBox.tsx

  • Added overflow-hidden on the outer rounded container.

  • Removed inner textarea radius/border/shadow to avoid double rounded-corner outlines.

Why

These changes make the layout visually consistent and remove distracting border artifacts.

Validation

  • Manually verified in DeepCode Studio:
    • Non-4-multiple card counts no longer reveal gray background.
    • No outer frame around all cards.
    • Cards touch with consistent single-width separators.
  • Manually verified in Research:
    • Search box no longer shows overlapping rounded corners.

Impact

  • UI-only changes.
  • No API, schema, or config changes.

related to #222

Summary by CodeRabbit

  • Style
    • Refined SearchBox component with streamlined textarea styling and improved overflow handling for better visual consistency.
    • Enhanced PaperGallery grid layout with a borderless design, conditional per-cell borders, and optimized responsive column configuration across different screen sizes.

@Li-Suqi Li-Suqi requested a review from jerry609 as a code owner March 12, 2026 20:52
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request delivers significant UI improvements to the web application by addressing visual inconsistencies in the DeepCode Studio's paper gallery and the Research search box. The changes enhance the aesthetic appeal and user experience by refining element spacing, borders, and background treatments, resulting in a cleaner and more professional interface.

Highlights

  • Studio Grid UI Polish: Eliminated unwanted gray background and inconsistent borders in the DeepCode Studio "All Papers" grid, ensuring consistent single-width borders between cards.
  • Research Search Box UI Fix: Resolved overlapping rounded corners in the Research search box by adjusting styling of nested containers.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • web/package-lock.json
    • Updated dependency metadata by adding "peer: true" to several packages.
    • Added "@types/trusted-types" as an optional dependency.
  • web/src/components/research/SearchBox.tsx
    • Applied "overflow-hidden" to the main search box container to correctly clip content within its rounded corners.
    • Removed redundant border, shadow, and rounded corner styles from the inner textarea to prevent visual artifacts.
  • web/src/components/studio/PaperGallery.tsx
    • Refactored the grid layout to remove the outer frame and background, switching to a gap-less design.
    • Implemented per-card border rendering logic to ensure consistent single-width borders between adjacent cards.
Activity
  • The pull request was created by Li-Suqi.
  • No human activity (comments, reviews) has occurred on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

📝 Walkthrough

Walkthrough

Both components receive styling refinements. SearchBox adds overflow containment and applies strict Tailwind overrides to textarea styling. PaperGallery redesigns grid rendering with conditional per-cell borders based on row/column position and introduces responsive column counts (1/2/4 across breakpoints).

Changes

Cohort / File(s) Summary
SearchBox Styling
web/src/components/research/SearchBox.tsx
Added overflow-hidden to container and applied explicit Tailwind overrides to textarea (!rounded-none !border-0 !shadow-none) to remove rounding, borders, and shadows.
PaperGallery Grid Layout
web/src/components/studio/PaperGallery.tsx
Redesigned grid from uniform borders to conditional edge borders; added responsive columns (1/2/4 at small/medium/extra-large); computed row/column indices and first-row/first-column flags to conditionally apply per-cell borders; reduced gap from gap-px to gap-0.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • PR #115: Modifies SearchBox.tsx with new props (anchorMode, onAnchorModeChange, onOpenMemory) and UI controls—related at the component level to this PR's styling adjustments.

Poem

🐰 A grid once rigid, now breaks free—
With borders that dance by row and by thee,
While SearchBox tightens its outer seam,
Responsive columns fulfill the dream! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: UI polish for two components (studio grid and research search box), which matches the core purpose of the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.

Change the reviews.profile setting to assertive to make CodeRabbit's nitpick more issues in your PRs.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces UI polishing for the studio grid and the research search box. The changes in PaperGallery.tsx correctly implement a grid with single-width borders, improving visual consistency. The fix in SearchBox.tsx resolves overlapping rounded corners. I've suggested a small refinement in SearchBox.tsx to simplify the CSS classes by removing unnecessary !important modifiers, which will improve maintainability.

disabled={disabled || isSearching}
className={cn(
"min-h-[56px] max-h-[200px] resize-none border-0 bg-transparent",
"min-h-[56px] max-h-[200px] resize-none border-0 bg-transparent !rounded-none !border-0 !shadow-none",

Choose a reason for hiding this comment

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

medium

The use of !important (!) modifiers in Tailwind CSS is generally discouraged as it can make styles harder to maintain. The cn utility uses tailwind-merge, which correctly handles conflicting classes by prioritizing the last one provided. You can achieve the same style overrides more cleanly without using !important. I've also removed the redundant border-0 class.

Suggested change
"min-h-[56px] max-h-[200px] resize-none border-0 bg-transparent !rounded-none !border-0 !shadow-none",
"min-h-[56px] max-h-[200px] resize-none bg-transparent rounded-none border-0 shadow-none",

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
web/src/components/research/SearchBox.tsx (1)

191-196: Remove redundant border-0 class.

border-0 appears twice—once without and once with the ! prefix. Only !border-0 is needed to override the base Textarea's border border-input.

Suggested fix
           className={cn(
-            "min-h-[56px] max-h-[200px] resize-none border-0 bg-transparent !rounded-none !border-0 !shadow-none",
+            "min-h-[56px] max-h-[200px] resize-none bg-transparent !rounded-none !border-0 !shadow-none",
             "px-5 sm:px-6 pt-4 pb-[56px]",
             "text-base placeholder:text-muted-foreground/50",
             "focus-visible:ring-0 focus-visible:ring-offset-0"
           )}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/components/research/SearchBox.tsx` around lines 191 - 196, In
SearchBox.tsx update the className passed to cn to remove the duplicate plain
"border-0" so only the important override "!border-0" remains (this keeps the
override of the base Textarea's "border border-input" while eliminating the
redundant class); locate the className string in the component's JSX (the cn
call around the textarea/Textarea element) and delete the non-prefixed
"border-0" token from the list.
web/src/components/studio/PaperGallery.tsx (1)

149-149: Consider initializing gridColumns from SSR-safe defaults to avoid potential flash.

gridColumns defaults to 4, but if the viewport is narrower (e.g., tablet at 768px–1279px), the CSS will render 2 columns while the border calculation still uses 4 columns until the effect runs. This could cause a brief incorrect border display on initial load for non-desktop users.

One option is to derive gridColumns reactively from CSS (via a ResizeObserver on the grid element counting actual columns), or accept the minor flash since the effect runs quickly.

Also applies to: 160-177, 435-438

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@web/src/components/studio/PaperGallery.tsx` at line 149, The state
gridColumns initialized to 4 can cause an initial mismatch with CSS-driven
column counts; update the component so gridColumns is derived from the rendered
grid instead of a hardcoded default: use a ResizeObserver (or similar) attached
to the grid DOM node to count computed columns (e.g., by measuring child
positions or computed gridTemplateColumns) and call setGridColumns accordingly
inside the observer; ensure this logic runs on mount and cleans up the observer
on unmount, and update any effects that use gridColumns (references to
setGridColumns and the border-calculation effect) to rely on the observed value
so the border is correct immediately for non-desktop viewports.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@web/src/components/research/SearchBox.tsx`:
- Around line 191-196: In SearchBox.tsx update the className passed to cn to
remove the duplicate plain "border-0" so only the important override "!border-0"
remains (this keeps the override of the base Textarea's "border border-input"
while eliminating the redundant class); locate the className string in the
component's JSX (the cn call around the textarea/Textarea element) and delete
the non-prefixed "border-0" token from the list.

In `@web/src/components/studio/PaperGallery.tsx`:
- Line 149: The state gridColumns initialized to 4 can cause an initial mismatch
with CSS-driven column counts; update the component so gridColumns is derived
from the rendered grid instead of a hardcoded default: use a ResizeObserver (or
similar) attached to the grid DOM node to count computed columns (e.g., by
measuring child positions or computed gridTemplateColumns) and call
setGridColumns accordingly inside the observer; ensure this logic runs on mount
and cleans up the observer on unmount, and update any effects that use
gridColumns (references to setGridColumns and the border-calculation effect) to
rely on the observed value so the border is correct immediately for non-desktop
viewports.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 220e9882-1144-46b7-b275-79e0d04158c7

📥 Commits

Reviewing files that changed from the base of the PR and between 95260e6 and d3e41a4.

⛔ Files ignored due to path filters (1)
  • web/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • web/src/components/research/SearchBox.tsx
  • web/src/components/studio/PaperGallery.tsx

@jerry609
Copy link
Owner

Superseded by #377.\n\nThis PR is blocked by repository code-scanning rules waiting on historical commits and merge commit , which cannot be retroactively given fresh CodeQL results. #377 rebuilds the same UI changes on top of current so GitHub can produce a new set of CI and CodeQL checks.

@jerry609
Copy link
Owner

Superseded by #377.

This PR is blocked by repository code-scanning rules waiting on historical commits d3e41a4 and merge commit 8f036c4, which cannot be retroactively given fresh CodeQL results. #377 rebuilds the same UI changes on top of current dev so GitHub can produce a new set of CI and CodeQL checks.

@jerry609
Copy link
Owner

这张 PR 当前被卡住,不是因为代码内容本身一定有问题,而是因为仓库现在启用了 Code Scanning / CodeQL 规则。GitHub 目前在等待历史提交 d3e41a4 以及对应的测试 merge commit 8f036c4 的 CodeQL 结果。

这两个提交是在当时旧的工作流配置下产生的,没有对应的 CodeQL 扫描记录。Code Scanning 是按 commit SHA 认结果的,不是按 PR 编号认结果,所以单纯 reopen 这张 PR,不会生成新的 SHA,也不会自动补出这两个旧提交的扫描结果。

也就是说,这张旧 PR 想解锁,必须产出一组新的 commit SHA,让当前工作流重新跑出新的 CodeQL 结果。基于这一点,我已经把同样的界面改动在当前 dev 上重建成新的 PR:#377。新的 PR 能正常产出 CI 和 CodeQL 结果,也更符合现在仓库的合并规则。

建议后续直接审和合并 #377,这张 #374 可以作为旧记录保留,或者在确认 #377 合并后关闭。

@sonarqubecloud
Copy link

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