refactor(web): lift and rename shared settings components/hooks/stores (LUM-1918)#32192
Conversation
…vel directories (LUM-1918) Moves shared code out of domains/settings/ into cross-domain top-level directories per CONVENTIONS.md (code used by 2+ domains → top-level): - SettingsCard → components/settings-card.tsx (contacts + settings) - SettingsShell → components/settings-shell.tsx (logs + settings) - SettingsSidebarTree → components/settings-sidebar-tree.tsx (logs + settings) - useCurrentPlatformAssistant → hooks/use-current-platform-assistant.ts (logs + settings) - currentPlatformAssistantStore → stores/current-platform-assistant-store.ts (logs + settings via hook) Updates 33 consumer files and removes 8 entries from .cross-domain-allowlist.json. Also fixes 4 pre-existing type errors in @vellumai/assistant-api imports that blocked all commits repo-wide: AssistantEventSchema → RelationshipStateUpdatedSchema, RelationshipStateUpdatedEvent → RelationshipStateUpdated. Closes LUM-1918 Co-Authored-By: ashlee@vellum.ai <ashlee@vellum.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…s stale The local node_modules had an old copy of @vellumai/assistant-api with different export names (RelationshipStateUpdated, RelationshipStateUpdatedSchema). The actual source at assistant/src/api/ exports AssistantEventSchema, RelationshipStateUpdatedEvent, and RelationshipStateUpdatedEventSchema. Reverts the import changes from the previous commit; the original imports were correct all along. Co-Authored-By: ashlee@vellum.ai <ashlee@vellum.ai>
There was a problem hiding this comment.
✦ APPROVE — reviewed at 69809191
Value: 8 cross-domain allowlist exemptions gone; contacts and logs no longer import from domains/settings/. Violation count drops from 103 to 95. Second PR in the LUM-1910 series.
What this does: Lifts 5 artifacts from domains/settings/ to top-level shared directories — 3 components, 1 hook, 1 store — and updates all 36 consumer import paths.
Placements — all correct:
| Artifact | New home | Reason |
|---|---|---|
SettingsCard |
components/ |
3 contacts files + 20+ settings files — cross-domain UI |
SettingsShell |
components/ |
logs-layout + settings-layout — cross-domain layout |
SettingsSidebarTree |
components/ |
logs-layout + settings-layout — cross-domain layout |
useCurrentPlatformAssistant |
hooks/ |
4 logs pages + assistant-picker — cross-domain hook |
currentPlatformAssistantStore |
stores/ |
Zustand store backing the hook — cross-domain state |
These follow the same pattern already in place: use-assistant-avatar.ts in hooks/, assistant-identity-store.ts in stores/, avatar-renderer.tsx in components/. Consistent.
The import renames (commits 1 + 2): The first commit included "fixes" to event-parser.ts, event-types.ts, and home-handlers.ts based on a stale local node_modules that had different @vellumai/assistant-api export names. Those changes broke type check and 9 test files. The second commit fully reverts them — AssistantEventSchema, RelationshipStateUpdatedEvent are the correct exports and are restored. Net diff across both commits is clean: only the settings lift changes land.
36 consumer updates: All mechanical import path swaps (@/domains/settings/components/settings-card.js → @/components/settings-card.js, etc.). Spot-checked a sample: contacts, logs, and settings domain files all updated correctly. @/ absolute paths throughout, .js extensions present.
.cross-domain-allowlist.json: 8 entries cleanly removed — 3 contacts entries (settings) and 5 logs entries (settings). Zero avatar or other accidental removals.
Merge gate: CI 7/7 ✅. Vex approves. Needs Devin or Codex second approval — suggest @devin review this PR on HEAD 69809191.
SettingsCard → DetailCard (detail-card.tsx) SettingsShell → SidebarShell (sidebar-shell.tsx) SettingsSidebarTree → SidebarTree (sidebar-tree.tsx) SettingsSidebarItem → SidebarItem SettingsCardProps → DetailCardProps These are generic layout primitives used across multiple domains, not settings-specific. The rename clarifies their purpose and prepares DetailCard and SidebarTree for future design library extraction. Co-Authored-By: ashlee@vellum.ai <ashlee@vellum.ai>
b38746b
Prompt / plan
LUM-1918: Cross-domain import violations — contacts and logs domains importing from
domains/settings/. Per CONVENTIONS.md — Decision rule for hooks/stores/utils, code used by 2+ domains must live in top-level shared directories.What moved and why
SettingsCardDetailCarddomains/settings/components/components/detail-card.tsxSettingsShellSidebarShelldomains/settings/components/components/sidebar-shell.tsxSettingsSidebarTreeSidebarTreedomains/settings/components/components/sidebar-tree.tsxuseCurrentPlatformAssistantdomains/settings/hooks/hooks/currentPlatformAssistantStoredomains/settings/stores/Why rename
The three components are generic layout primitives, not settings-specific. They originated in the settings domain but are used across multiple domains (contacts, logs, settings). The "Settings" prefix was misleading — these are a detail card, a sidebar shell, and a sidebar navigation tree.
Related type/interface renames:
SettingsCardProps→DetailCardPropsSettingsSidebarItem→SidebarItemFollow-up: design library extraction
LUM-1934 —
DetailCard(zero app deps) andSidebarTree(needs react-router decoupling) are candidates for@vellum/design-library.SidebarShellstays app-level due to routing coupling.Allowlist changes
8 entries removed from
.cross-domain-allowlist.json:contacts/components/assistant-channels-detail.tsx(settings)contacts/components/contact-detail-view.tsx(settings)contacts/components/guardian-detail-view.tsx(settings)logs/logs-layout.tsx(settings)logs/pages/emails-page.tsx(settings)logs/pages/system-events-page.tsx(settings)logs/pages/trace-page.tsx(settings)logs/pages/usage-page.tsx(settings)Violation count: 103 → 95 (80 files → 72 files)
Not in scope
chat → settingsviolation (navigation-handlers.tsimportsgetSettingsRouteForClientTab) — belongs to LUM-1923Test plan
bun run lint— passes cleanbunx tsc --noEmit— passes cleanCloses LUM-1918
Link to Devin session: https://app.devin.ai/sessions/4b3b130bbf274e5487da3b4992883093
Requested by: @ashleeradka