Skip to content

fix(web): make sidebar i18n reactive and refine template card/icon UI - #16646

Merged
JinHai-CN merged 7 commits into
infiniflow:mainfrom
yooxdb:fix/agent-templates-i18n
Aug 28, 2026
Merged

JinHai-CN merged 7 commits into
infiniflow:mainfrom
yooxdb:fix/agent-templates-i18n

Conversation

@yooxdb

@yooxdb yooxdb commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Several UI fixes in the agent template and dataset table components:

  • Sidebar menu labels (template-sidebar.tsx) were computed once at module load using i18next's t directly, so they never updated on language change. Moved menuItems into the component with useTranslation + useMemo so labels re-render reactively.
  • "Use this template" button on template cards could clip long translated labels since it relied on a fixed w-1/3 width; replaced with max-w-[280px] and whitespace-normal so the label wraps instead of being cut off.
  • File upload preview icon (FileText) looked too bold at this size; added strokeWidth={1} to match the rest of the icon set.
  • Parsing status tooltip icon used <sup> for a question-mark icon, which superscripted and misaligned it; replaced with an inline-flex <span> and reduced icon size to align with the percentage text.
Before After
*Responsive sidebar i18n + show EN description (fallback) image image
*Overflowed button label image image
*Question mark alignment 스크린샷 2026-07-01 오후 11 31 43 image
*File icon's strokeWidth image image

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 5, 2026
@coderabbitai

coderabbitai Bot commented Jul 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d38129b3-b9c3-4178-a0e1-3ef6a51c8866

📥 Commits

Reviewing files that changed from the base of the PR and between 9b7cc2d and 20963e4.

📒 Files selected for processing (6)
  • web/src/components/card-container.tsx
  • web/src/components/file-uploader.tsx
  • web/src/locales/ko.ts
  • web/src/pages/agents/template-card.tsx
  • web/src/pages/agents/template-sidebar.tsx
  • web/src/pages/dataset/dataset/parsing-status-cell.tsx
🚧 Files skipped from review as they are similar to previous changes (5)
  • web/src/pages/dataset/dataset/parsing-status-cell.tsx
  • web/src/components/card-container.tsx
  • web/src/pages/agents/template-sidebar.tsx
  • web/src/components/file-uploader.tsx
  • web/src/locales/ko.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

This PR updates template language mapping, sidebar translations, component spacing, icon presentation, and two Korean translation strings.

Changes

Miscellaneous UI and i18n tweaks

Layer / File(s) Summary
Template card language mapping and button styling
web/src/pages/agents/template-card.tsx
Maps languages to zh, de, or en. Updates the “use template” button positioning and label wrapper.
Template sidebar menu translation via hook
web/src/pages/agents/template-sidebar.tsx
Builds translated menu items inside SideBar with useTranslation and useMemo.
Component presentation and locale adjustments
web/src/components/file-uploader.tsx, web/src/pages/dataset/dataset/parsing-status-cell.tsx, web/src/components/card-container.tsx, web/src/locales/ko.ts
Sets the fallback file icon stroke width, adjusts the parsing-status icon wrapper and size, adds a decorative spacer, and removes periods from two Korean strings.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 20963

This change updates reactive sidebar translations and refines template, upload, and parsing-status presentation without changing backend behavior or user permissions; no actionable merge-blocking risk remains.

Suggested reviewers: dcc123456

Poem

A rabbit checks the button’s place,
Maps each language with care and grace,
The sidebar labels bloom anew,
Icons gain a gentler view,
And spacing makes the layout true.

🚥 Pre-merge checks | ✅ 4 | ❌ 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the primary changes: reactive sidebar i18n and related template card and icon UI refinements.
Description check ✅ Passed The description includes the required Summary section and provides clear background, details for each change, and before-and-after screenshots. It is complete and relevant.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI

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.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/src/pages/agents/template-card.tsx (1)

23-31: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

language needs to track the current locale

useMemo is caching a value derived from i18n.language with an empty dependency list, so the template title/description/avatar name and lang attribute can stay on the initial locale after a language switch. Add i18n.language to the dependencies or derive language directly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/pages/agents/template-card.tsx` around lines 23 - 31, The language
value in TemplateCard is memoized with an empty dependency list, so it can stay
stuck on the initial locale after a language switch. Update the `useMemo` in
`template-card.tsx` to depend on `i18n.language`, or remove the memo and derive
`language` directly so the template title, description, avatar name, and `lang`
attribute always reflect the current locale.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@web/src/pages/agents/template-card.tsx`:
- Around line 23-31: The language value in TemplateCard is memoized with an
empty dependency list, so it can stay stuck on the initial locale after a
language switch. Update the `useMemo` in `template-card.tsx` to depend on
`i18n.language`, or remove the memo and derive `language` directly so the
template title, description, avatar name, and `lang` attribute always reflect
the current locale.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 80991801-a8a3-43ce-9952-7b22ec4fa64e

📥 Commits

Reviewing files that changed from the base of the PR and between 0fcfb38 and a925a0a.

📒 Files selected for processing (5)
  • web/src/components/file-uploader.tsx
  • web/src/locales/ko.ts
  • web/src/pages/agents/template-card.tsx
  • web/src/pages/agents/template-sidebar.tsx
  • web/src/pages/dataset/dataset/parsing-status-cell.tsx

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

🧹 Nitpick comments (1)
web/src/components/card-container.tsx (1)

15-15: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider padding instead of an empty spacer element.

An extra aria-hidden grid child solely for a bottom gap can be replaced with pb-6 (or similar) on the container div, avoiding an unnecessary DOM node for pure spacing.

♻️ Alternative using padding
     <div
       className={cn(
-        'grid gap-6 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 auto-rows-auto content-start',
+        'grid gap-6 pb-6 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5 auto-rows-auto content-start',
         className,
       )}
     >
       {children}
-      <div className="col-span-full h-6" aria-hidden="true" />
     </div>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/components/card-container.tsx` at line 15, Replace the empty spacer
element in card-container with container padding instead of an extra grid child.
Update the wrapping div in the card container component to use bottom padding
(for example, pb-6) and remove the aria-hidden spacer node so spacing is handled
by the parent layout. Keep the change localized to the card-container component
and preserve the existing grid behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@web/src/components/card-container.tsx`:
- Line 15: Replace the empty spacer element in card-container with container
padding instead of an extra grid child. Update the wrapping div in the card
container component to use bottom padding (for example, pb-6) and remove the
aria-hidden spacer node so spacing is handled by the parent layout. Keep the
change localized to the card-container component and preserve the existing grid
behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: db1a1f25-6fd1-40b5-8dda-9a2f77fb9a2a

📥 Commits

Reviewing files that changed from the base of the PR and between 099d49e and 2961a9a.

📒 Files selected for processing (1)
  • web/src/components/card-container.tsx

@yooxdb

yooxdb commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@dcc123456 I just wanted to gently follow up in case this got buried under other activity. Whenever you have a moment, I'd really appreciate a review. Thanks!

@JinHai-CN
JinHai-CN requested a review from dcc123456 August 27, 2026 10:59
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@JinHai-CN JinHai-CN added the ci Continue Integration label Aug 28, 2026
@JinHai-CN
JinHai-CN merged commit 17a5960 into infiniflow:main Aug 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants