refactor(frontend): the global stylesheets move into @agenta/ui, one token source for oss, ee and mobile - #5874
refactor(frontend): the global stylesheets move into @agenta/ui, one token source for oss, ee and mobile#5874ardaerzin wants to merge 3 commits into
Conversation
|
@coderabbitai review |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR centralizes shared UI tokens and surface styles, integrates them into mobile, OSS, and EE applications, adds shared message rendering to mobile, updates Markdown rendering dependencies, and introduces reusable home template components. ChangesShared UI integration
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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 |
52698fd to
8a4399f
Compare
09cb133 to
322ae65
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
web/packages/agenta-home-ui/src/TemplateCard.tsx (1)
10-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReduce the design prose in this source file.
Move the product rationale to design documentation or the PR description. Keep only a short comment if it protects a non-obvious implementation constraint. As per coding guidelines, keep in-code comments to at most one short line unless they document a genuinely surprising constraint.
Proposed change
-/** - * A template, in the same card shape an agent uses. - * - * A template IS an agent you haven't made yet, so the two read as one object type: monogram - * straddling the top edge, name, description, then a footer of the connections it needs. The - * design's "1.2k uses" has no telemetry behind it — the footer carries what the template actually - * declares (its tools and when it fires) instead of an invented popularity number. - */ +/** Selectable card for an agent starter template. */Source: Coding guidelines
web/mobile/scripts/generate-shadcn-tokens.ts (1)
66-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winShorten the added implementation comments.
The added comments exceed the one-short-line policy. Keep only short constraints that are necessary at the code site.
web/mobile/scripts/generate-shadcn-tokens.ts#L66-L68: reduce the zinc-scale rationale to one short line.web/mobile/scripts/generate-shadcn-tokens.ts#L75-L76: reduce the token-coverage rationale to one short line.web/mobile/scripts/generate-shadcn-tokens.ts#L89-L92: reduce the overlay-token rationale to one short line.web/mobile/scripts/generate-shadcn-tokens.ts#L113-L117: reduce the surface-role rationale to one short line.web/mobile/scripts/generate-shadcn-tokens.ts#L148-L152: reduce the surface-ladder rationale to one short line.web/mobile/scripts/generate-shadcn-tokens.ts#L204-L206: reduce the shell-variable rationale to one short line.web/mobile/scripts/generate-shadcn-tokens.ts#L255-L257: reduce the composer-variable rationale to one short line.web/ee/src/pages/_app.tsx#L4-L5: reduce the Streamdown stylesheet rationale to one short line.web/oss/src/pages/_app.tsx#L8-L9: reduce the renderer-injection rationale to one short line.As per coding guidelines, “Keep in-code comments to at most one short line.”
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: c9c0b082-3b93-4117-8bf4-a855dc5543eb
⛔ Files ignored due to path filters (2)
web/mobile/src/styles/theme.generated.cssis excluded by!**/*.generated.*web/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (19)
web/ee/package.jsonweb/ee/src/pages/_app.tsxweb/mobile/next.config.tsweb/mobile/scripts/generate-shadcn-tokens.tsweb/mobile/src/pages/_app.tsxweb/mobile/src/styles/globals.cssweb/oss/next.config.tsweb/oss/package.jsonweb/oss/src/pages/_app.tsxweb/oss/src/styles/globals.cssweb/oss/tailwind.config.tsweb/packages/agenta-home-ui/src/TemplateCard.tsxweb/packages/agenta-home-ui/src/TemplateProviderMarks.tsxweb/packages/agenta-ui/src/styles/code-editor-styles.cssweb/packages/agenta-ui/src/styles/custom-resize-handle.cssweb/packages/agenta-ui/src/styles/editor-theme.cssweb/packages/agenta-ui/src/styles/surfaces.cssweb/packages/agenta-ui/src/styles/theme-variables.cssweb/scripts/generate-tailwind-tokens.ts
| /* Plain CSS, not `@apply scrollbar-*`: that plugin exists only in the desktop app's | ||
| Tailwind v3 config, and one unknown utility makes the WHOLE stylesheet unparsable | ||
| wherever it is imported. Same rendering, no plugin dependency. */ | ||
| &::-webkit-scrollbar { | ||
| height: 0; | ||
| } | ||
| &::-webkit-scrollbar-thumb { | ||
| background-color: #ddd; | ||
| } | ||
| &::-webkit-scrollbar-track { | ||
| background-color: #f0f0f0; | ||
| } | ||
|
|
||
| &:hover { | ||
| @apply scrollbar-h-[2px]; | ||
| &:hover::-webkit-scrollbar { | ||
| height: 2px; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Use theme-aware scrollbar colors.
Lines 214-217 add raw colors in a shared stylesheet. These colors do not adapt to the active appearance. Use shared scrollbar tokens and verify both themes.
Proposed fix
&::-webkit-scrollbar-thumb {
- background-color: `#ddd`;
+ background-color: var(--ag-scroll-thumb);
}
&::-webkit-scrollbar-track {
- background-color: `#f0f0f0`;
+ background-color: transparent;
}As per coding guidelines, “do not use raw hex colors” and implement light and dark states for changed UI elements.
📝 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.
| /* Plain CSS, not `@apply scrollbar-*`: that plugin exists only in the desktop app's | |
| Tailwind v3 config, and one unknown utility makes the WHOLE stylesheet unparsable | |
| wherever it is imported. Same rendering, no plugin dependency. */ | |
| &::-webkit-scrollbar { | |
| height: 0; | |
| } | |
| &::-webkit-scrollbar-thumb { | |
| background-color: #ddd; | |
| } | |
| &::-webkit-scrollbar-track { | |
| background-color: #f0f0f0; | |
| } | |
| &:hover { | |
| @apply scrollbar-h-[2px]; | |
| &:hover::-webkit-scrollbar { | |
| height: 2px; | |
| /* Plain CSS, not `@apply scrollbar-*`: that plugin exists only in the desktop app's | |
| Tailwind v3 config, and one unknown utility makes the WHOLE stylesheet unparsable | |
| wherever it is imported. Same rendering, no plugin dependency. */ | |
| &::-webkit-scrollbar { | |
| height: 0; | |
| } | |
| &::-webkit-scrollbar-thumb { | |
| background-color: var(--ag-scroll-thumb); | |
| } | |
| &::-webkit-scrollbar-track { | |
| background-color: transparent; | |
| } | |
| &:hover::-webkit-scrollbar { | |
| height: 2px; |
Source: Coding guidelines
…token source for oss, ee and mobile
code-editor-styles.css painted its thumb #ddd on an #f0f0f0 track and editor-theme.css painted #999 — fixed light values in stylesheets that oss, ee and mobile all import, so the scrollbars stayed light-mode in dark. The --ag-scroll-thumb token already carries both appearances and .ag-scroll-quiet already uses it; the tracks follow that class's transparent treatment.
322ae65 to
be3fe94
Compare
Two commits: register the new workspace packages in the OSS and EE builds, then move the global
stylesheets into
@agenta/uiso all three apps read one token source instead of three copiesthat quietly disagreed about spacing and color.
Not run in a browser — static gates only (
pnpm lint-fix24/24,tsc --noEmitcleanfor
@agenta/shared,ui,entities,entity-ui,settings-ui,oss,ee,mobile).Stacked on
playground/de-antd; review only this lane's diff.