fix(web): UI polish for studio grid and research search box#374
fix(web): UI polish for studio grid and research search box#374Li-Suqi wants to merge 0 commit intojerry609:devfrom
Conversation
Summary of ChangesHello, 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
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
📝 WalkthroughWalkthroughBoth 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip You can make CodeRabbit's review stricter and more nitpicky using the `assertive` profile, if that's what you prefer.Change the |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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.
| "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", |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
web/src/components/research/SearchBox.tsx (1)
191-196: Remove redundantborder-0class.
border-0appears twice—once without and once with the!prefix. Only!border-0is needed to override the base Textarea'sborder 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 initializinggridColumnsfrom SSR-safe defaults to avoid potential flash.
gridColumnsdefaults to4, 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
gridColumnsreactively from CSS (via aResizeObserveron 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
⛔ Files ignored due to path filters (1)
web/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
web/src/components/research/SearchBox.tsxweb/src/components/studio/PaperGallery.tsx
|
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. |
|
这张 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 结果,也更符合现在仓库的合并规则。 |
|



Summary
This PR fixes two UI issues in the web app:
All Papersgrid showed unwanted gray background and inconsistent borders when the number of cards was not a multiple of 4.What Changed
Updated
web/src/components/studio/PaperGallery.tsxChanged 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.tsxAdded
overflow-hiddenon 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
Impact
related to #222
Summary by CodeRabbit