refactor(web): consume DS primitives, remove local component copies#30698
Conversation
Replace locally-forked UI components and hooks with their newly
promoted counterparts from @nous-research/ui:
Deleted local components (now in DS):
- components/ui/input.tsx, label.tsx, separator.tsx, card.tsx,
confirm-dialog.tsx
- components/Toast.tsx, BottomPickSheet.tsx, NouiTypography.tsx
- hooks/useToast.ts, useModalBehavior.ts, useBelowBreakpoint.ts,
useConfirmDelete.ts
Import updates across 25 files to use DS deep imports:
- @nous-research/ui/ui/components/{input,label,separator,card,
confirm-dialog,toast,bottom-sheet}
- @nous-research/ui/ui/components/typography (replaces NouiTypography)
- @nous-research/ui/hooks/{use-toast,use-modal-behavior,
use-below-breakpoint,use-confirm-delete}
Requires design-language >= feat/promote-hermes-web-primitives.
Co-authored-by: Cursor <cursoragent@cursor.com>
🔎 Lint report:
|
|
I could not push directly to this branch from this checkout, so I opened a rebased replacement/fixup PR for the Nix failure here: #30749.\n\nRoot cause: the web refactor imports @nous-research/ui DS primitive subpaths that are not available from the locked package version in Nix. Fix updates @nous-research/ui/package-lock and keeps useModalBehavior local because that hook is not exported by the package. Verified with npm run build. |
…tives Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # web/src/components/BottomPickSheet.tsx # web/src/components/SidebarFooter.tsx # web/src/components/ui/card.tsx # web/src/components/ui/confirm-dialog.tsx # web/src/pages/ChatPage.tsx
|
bugbot run |
|
Skipping Bugbot: Unable to authenticate your request. Please make sure Bugbot is properly installed and configured for this repository. |
The web/package-lock.json changed when bumping @nous-research/ui to 0.18.0, so the fetchNpmDeps fixed-output hash in nix/web.nix was stale and the nix build failed. Update it to the hash prefetch-npm-deps computes for the new lockfile. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks @joechaotic — I've now applied that same fix directly on this branch, so #30749 should be redundant:
All CI is green now (both Suggest we close #30749 in favor of this one |
Picks up the deferred GPU-tier detection fix (design-language) that stops the synchronous WebGL probe from blocking first paint, which was causing a boot-time flash in the dashboard backdrop. nix/web.nix npmDepsHash is a placeholder here and is corrected in the follow-up commit using the hash reported by the Nix CI job. Co-authored-by: Cursor <cursoragent@cursor.com>
The web/package-lock.json changed when bumping @nous-research/ui to 0.18.2, so the fetchNpmDeps fixed-output hash in nix/web.nix was stale. Update it to the hash prefetch-npm-deps computes for the new lockfile. Co-authored-by: Cursor <cursoragent@cursor.com>
In loopback mode the dashboard's identity probe (/api/auth/me) returns 401 by design — AuthWidget swallows it and renders nothing. But the probe routed through fetchJSON, whose loopback 401 handler treats a 401 as a rotated session token and full-page-reloads to pick up a fresh one. That reload is guarded by a one-shot sessionStorage flag which every *successful* request clears, so with auth/me reliably 401ing and the other dashboard calls (status/config/sessions) reliably succeeding, the guard never sticks and the page reload-loops indefinitely (the "boot flash"). Add an allowUnauthorized option to fetchJSON that skips only the loopback stale-token reload (the 401 still throws so AuthWidget can catch it, and the gated-mode login_url envelope redirect is unaffected), and use it for getAuthMe. Co-authored-by: Cursor <cursoragent@cursor.com>
…ds-primitives refactor(web): consume DS primitives, remove local component copies
What does this PR do?
Replaces locally-forked UI components and hooks in the web dashboard with their
newly promoted counterparts from
@nous-research/ui, reducing duplication andcentralizing shared UI primitives in the design system.
Depends on NousResearch/design-language#23 (merged, published as
@nous-research/ui@0.18.0), which promoted these primitives and consolidatedthe dialogs onto Radix UI.
Type of Change
Changes Made
Bumped design-system dependency
web/package.json:@nous-research/ui→0.18.0(the version that ships thepromoted primitives + hooks)
Deleted local components (now in DS)
web/src/components/ui/input.tsxweb/src/components/ui/label.tsxweb/src/components/ui/separator.tsxweb/src/components/ui/card.tsxweb/src/components/ui/confirm-dialog.tsxweb/src/components/Toast.tsxweb/src/components/BottomPickSheet.tsxweb/src/components/NouiTypography.tsxDeleted local hooks (now in DS)
web/src/hooks/useToast.tsweb/src/hooks/useBelowBreakpoint.tsweb/src/hooks/useConfirmDelete.tsImport updates
All imports updated to use DS deep import paths:
@nous-research/ui/ui/components/{input,label,separator,card,confirm-dialog,toast,bottom-sheet}@nous-research/ui/ui/components/typography/indexand.../typography/h2@nous-research/ui/hooks/{use-toast,use-below-breakpoint,use-confirm-delete}How to Test
cd web && npm installnpm run build— type-checks (tsc -b) and builds cleannpm run dev— verify all pages render correctlyChecklist
Code
Documentation & Housekeeping
cli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AInfographic