Repository navigation
Build the Platform Core, Chat, and member integrations UI - #9687
emir-karabeg wants to merge 1168 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
[Medium impact] The changes reach the standalone Platform’s Home, Chat, and Settings flows on web and Desktop. Fix the lost Stop control and covered desktop panel tabs before merging. Findings
SummaryAdds standalone Home, Chat and Settings routes for browsers and Sim Desktop, with shared controls, gated fixtures and browser/Electron checks.
|
| onStop={ | ||
| last?.response?.state === 'running' ? () => transition(last, 'stopped') : undefined | ||
| } | ||
| onSubmit={(draft) => { | ||
| const next = userTurn(draft) | ||
| if (id && !removed) { | ||
| changes.setTurnsFor(id, [...turns, next]) |
There was a problem hiding this comment.
In /chat/customer-onboarding?state=full, pressing Enter on a follow-up appends a user turn while the response is running. onStop then disappears because it checks only the last turn, which now has no response. The earlier response stays “Working” with no way to stop it. Track the running turn separately, or block submission while it is running.
| padding-inline: var(--spacing-12); | ||
| min-inline-size: 0; | ||
| height: var(--height-nav); | ||
| border-block-end: var(--spacing-stroke-default) solid var(--ui-divider); | ||
| } | ||
| :global([data-sim-desktop-title-bar]) .header { | ||
| height: var(--spacing-48); | ||
| -webkit-app-region: drag; |
There was a problem hiding this comment.
With the desktop sidebar collapsed, expanding the chat panel puts its tabs under the desktop toolbar and native window buttons. The shell places the content at the top-left, but the panel header keeps only 12px of left padding. Unlike the conversation header, it does not use --ui-navigation-inset. Reserve that space when the panel takes over so its first tab and close control remain clickable.
| <ChatPanels workspaces={shell?.workspaces ?? []} data={panel} key={id?.[0] ?? 'new'}> | ||
| <ChatScreen data={data?.chat ?? null} chatId={id?.[0]} /> |
There was a problem hiding this comment.
Switching chats discards unsent text and selected files. MessageComposer keeps both only in local state, while this route keys the whole panel tree by chat ID. Returning to the original chat creates a fresh composer. Keep drafts in the session, keyed by chat ID, so ordinary navigation does not erase unfinished messages.
| const [displayName, setDisplayName] = useState(name ?? '') | ||
| const [picture, setPicture] = useState<string>() |
There was a problem hiding this comment.
Saving a display name or choosing a profile picture lasts only until the user leaves Preferences. ProfileSettings owns these values locally and is removed on other Settings sections. Returning restores the fixture name and drops the picture. Keep these local edits in the session provider; no database write is needed.
| <ProductSurface preference={appearance}> | ||
| <PlatformShell data={shell} desktopTitle={desktopTitle} navigation={navigation}> | ||
| {children} | ||
| </PlatformShell> |
There was a problem hiding this comment.
Navigation resets shell changes
Each page creates its own PlatformShell, so moving between Home, Chat and Settings resets inbox read marks, dismissed notices and chat sorting. For example, reading an unread item, opening a chat and returning makes that item unread again. Move this session state above the page boundary, alongside the existing chat edits and interface preferences.
There was a problem hiding this comment.
5 issues found and verified against the latest diff
Confidence score: 3/5
- In
chat-screen.tsx, submitted attachments can reappear in the new chat when changing the chat ID remounts the composer. Clear the attachment draft when the send succeeds. - In
workspace-list.tsx, keyboard users get no visible focus indicator on workspace buttons. Add a:focus-visibletreatment. - In
product-surface.tsx, users with a dark system theme can see a light flash before hydration. Resolve the system theme before first paint. - In
notification-tray.module.css, notification controls can sit under the home indicator on notched mobile browsers. Account for the bottom safe-area inset.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/platform/design-system/components/workspace-list.tsx">
<violation number="1" location="apps/sim/platform/design-system/components/workspace-list.tsx:43">
P2: This new keyboard-focusable workspace button has no visible focus indicator because the global stylesheet removes outlines and `.workspaceHit` adds none. Add a shared or workspace-specific `:focus-visible` treatment so keyboard users can identify the active row.</violation>
</file>
<file name="apps/sim/platform/design-system/components/product-surface.tsx">
<violation number="1" location="apps/sim/platform/design-system/components/product-surface.tsx:10">
P2: System appearance always renders light on the server, causing dark-system users to see a light flash before hydration applies the media-query result. Resolve the system theme before first paint, such as with a CSS media-query path plus explicit-theme override or a small theme bootstrap.</violation>
</file>
<file name="apps/sim/platform/design-system/components/select.tsx">
<violation number="1" location="apps/sim/platform/design-system/components/select.tsx:37">
P2: An arbitrary `theme` query can reach this controlled value without matching any option, so the Theme picker renders blank even though the surrounding product falls back to `system`. Ignore values outside `options` here or pass the normalized theme from the settings screen.</violation>
</file>
<file name="apps/sim/platform/design-system/features/chat/chat-screen.tsx">
<violation number="1" location="apps/sim/platform/design-system/features/chat/chat-screen.tsx:100">
P2: The first send from `/chat` clears the composer only until `router.replace` changes `id`; this prop then remounts `MessageComposer` with the unchanged draft attachments, so submitted files reappear in the new chat’s composer. Track and consume the initial draft when submitting before navigation.</violation>
</file>
<file name="apps/sim/platform/design-system/components/notification-tray.module.css">
<violation number="1" location="apps/sim/platform/design-system/components/notification-tray.module.css:10">
P2: The fixed notification stack ignores the bottom safe-area inset, so its action and dismiss controls can sit under the home indicator on notched mobile browsers. Use `max(var(--spacing-20), env(safe-area-inset-bottom))` for the bottom offset.
(Based on your team's feedback about toast safe-area minimum.) [8c7692a3-398e-4004-b266-f2a76922d36c]</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
6133099 to
8d35586
Compare
…sheet load, and set the sync state as text
…e chat panel's tab reordering
…e hidden shortcut hint, and the + menu's on-demand workspace browsing
…Mono props and their rules
…y flagged tab is hidden
…ing, gate the file page like its siblings AccessBoundary painted the tab frame while the permission group was pending, then swapped to the record's own anatomy. It now renders nothing until the policy answers. The Access updated prompt drops its loading copy, and the file page takes the hideFilesTab boundary instead of a client redirect.
…every detail page Tables, knowledge bases, documents and files read like a Logs run: a failed read shows the shared FailureNotice with Retry in the tab frame, and a 404 answers not found (a chat panel tab says so instead). The table grid no longer calls every failed read "Table not found", the document fetch keeps its 404 status, and chunk read failures gain Retry. The workflow canvas shows a failed workflow list read with its retry instead of redirecting as if empty, and a workflow gone from the workspace falls back to the list.
…s through a failed refresh Tables, Files, Knowledge bases and Workflows waited on their folders read forever when it failed, and swapped a loaded list for the failure notice when a background refresh failed. A first read that fails now offers Retry for the read that failed, and data already on screen stays. Files uploads count toward the close-page guard again, as legacy's did.
The canvas menu's Open logs linked with legacy's workflowIds key, which the Platform's Logs list does not read, so it showed every run.
…r request like their siblings
…s in search The list joins the workspace-workflows realtime room, as legacy's sidebar did, so another member's or Chat's workflow and folder changes refresh it, and it registers New workflow, New folder and Import in search's This page group like the other resource lists.
…oup read fails A failed permission group read left the config empty, so the navigation listed and rendered the sections the group withholds. It now reads as a failure with Retry, as legacy's access boundary refused to guess.
…kspace route An approval notification for a chat with no organization opened nothing. It now opens /workspace/:id/chat/:chatId, which redirects to the chat's page.
…egacy did The Subscription section showed the switch to team and organization admins instead, the inverse of legacy's personal-billing-only rule.
A reply linked /workspace/:id/chat/:chatId and leaned on its permanent redirect. The executor already reads the workspace row, so it now takes its organization and links the canonical chat (or Home); an organization-less workspace keeps the legacy URL, which resolves the viewer's organization.
… panel as declined Product removals read Declined, as the contract requires. Table views and CSV import get their own rows with what replaced them, the editor Copilot panel is recorded as baked into Chat, and the access boundary, upload guard, Files and Workflows rows match the code.
…without the hidden section
# Conflicts: # apps/sim/platform/docs/org-parity.md
Home, Chat, Settings and organization integrations use the shared navigation shell and real routes in the isolated Platform Next.js app. The browser and Sim Desktop share the renderer. A default-off server fixture supplies populated, empty and stress states without a database.
The shared App Router layout owns the sidebar. Selecting a chat, visiting Settings, or reopening the compact drawer preserves the reader’s position. Command K uses the shared menu rows and headings: Home, Settings and Integrations keep their icons, and workspace and chat results are text-only. Search, results and shortcut hints align to one inset, and moving from pointer to keyboard leaves only the active result highlighted.
Home and Chat share a reading column and a Recents component. Home opens recent websites in another tab; dismissal carries into Chat. The activity chart switches between Tasks run and Searches without losing its date range. Widgets and notifications share a height ceiling and scroll independently. Calendar’s Now control returns to the current day and time. Events open an external tab only when a provider supplies a URL; attendees have their own popover.
Navigation, tabs, recents and attachment previews share ControlRow. Invite recipients use compact address tags with an always-visible remove button inside each tag. Form dialogs focus the first available field and restore focus on close. Invite accepts typed and pasted addresses, supports keyboard removal and leaves sending to Phase 3. Chat keeps prose and tool activity aligned, and shares its time formatting and copy feedback with the rest of the Platform.
The member Integrations inventory uses workspace catalog descriptions for each provider. Its detail shows the provider name and description, then one connected credential with its actions menu. The inline connection prompt shares Home’s Email and Calendar styling and links to the Sim Search setup guide. Eligible tool approvals remain individual. Known OAuth permissions are grouped by purpose and always visible. Managed Search providers show their actual read-only operations, including Fireflies meeting search, transcripts, and summaries. The server fixture flag gates all sample connections. Member inventory and operation mapping.
See the component ownership map, Platform contract and Core/Chat source-state inventory. To run locally:
SIM_PLATFORM_FIXTURES=1 bun run --cwd apps/sim dev:platform; visit/home?state=full,/chat/weekly-review?state=full/settings?state=full, or/integrations?state=full.Verification exercises the production Next build, Chromium with fixture-on and fixture-off servers, and the native Electron renderer. Browser journeys measure scroll bounds, hit targets and spacing, exercise keyboard selection and focus return, and distinguish resting/hover/pressed feedback in both themes. The design audit checks ownership, token and variant use, timers, modal chrome and the fixture boundary. It recognizes JSX returned by local render helpers and active route fallbacks. The tracked Platform skill and contract route new work, cleanup and Settings reviews to the correct component library, and distinguish shared preferences from decisions owned by one feature.
Stacked on #9667, which targets staging.
Chat now steers instead of queueing. A message sent during a turn is applied to that turn at its next step, through the worker's durable v2 endpoint (simstudioai/mothership#929, which must deploy first; against an older worker a message waits for the turn's end and goes out as the next turn). If the turn ends without applying it, it goes out once as the next turn under the same id, and the worker refuses it if a run already applied it. The client queue is removed from every chat surface. Undelivered messages show a status line with Retry and Dismiss. Outgoing messages survive a reload through a per-tab journal, and anything past 10 minutes never sends itself.
apps/sim/scripts/test-chat-steering-e2e.tsproves this across a real browser, app, worker and database (bun run test:chat-steering:e2e, not wired into CI).