Repository navigation
Build the Platform Core, Chat, and member integrations UI - #9687
emir-karabeg wants to merge 381 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
The zone's destination rows have no pointer handler, so the hook is ready but unwired. It reads each page under its hooks' own keys after a dwell, behind the same gates.
Confirming a removal returned focus to the control that opened it, which goes away with its row and left focus on the body. Links delete and member removal now move it to the row that took its place, then the one before, then the list. Focus the viewer has moved elsewhere stays, and a failed removal arms nothing.
… parses it The main app's last-resort guard lives in its root layout, so the zone had none. The decision moves to lib/core/utils/paste-admission with no design-system import, the main app's guard reads it, and the zone mounts its own in LiveProviders, reporting through the tray. Also moves the zone's hook tests off the test mocks its seam may not import.
… and sessions Each adapter owns its mutations and toasts, so the view keeps state and markup only. The baseline drops from 37 to 30 view data-hook edges; the remainder needs per-view rework.
…into wip/platform-org-wiring
Chat SSE is wired, the Admin, Mothership, Integrations and Credential Groups sections exist with their own paths, Customize Home has a persisted store and needs no migration, and the Home gate is one row's Done, not another's Open. Adds rows for the paste guard, tab titles, the desktop tray, first paint and nav warmers. Integrations docs no longer say one personal credential.
… history The surface response carries no user id, so the seed keyed the entry to nobody and the client never found it. The type-check caught what the test's cast hid. A failed profile read gives up the seat.
…p converging check:platform-convergence holds the embedded file count and the paths both trees hold to a shrink-only baseline, and AGENTS.md gains the recipe for converging a domain.
…into test/chat-steering-e2e-final The org view moved to use-organization-conversation and use-composer, which kept the queue: removed there, with Retry and Dismiss in the shared thread props and the queued-edit test gone. The acceptance suite split into checks/, so the steering scenarios moved to checks/chat.ts; its harness stubs the socket token itself, so the throttle allowance is gone with the file it was in.
…ailing column A primary column's 32% only reads against other shares. With its siblings hidden, the fixed layout hands the rest of the table to the action column, which is what broke names mid-word. Search and department also reach the page gutter at phone width, and the e2e suite holds both relationships.
A quiet network passes before a lazy section has loaded enough to send its read, so a green walk could be a set of skeletons. A route now waits for no read and no loading status or busy region on screen, fails at a deadline naming what persists, and reports how long it took.
A pane with its own ceiling, like the Home calendar, stays a scroller at any height, so counting its overflow left 1300px of blank page in the shot. Also holds Home's typed placeholder at its full text for the shot.
… top bar The surface carrying the title into the host's bar painted the canvas, which the bar's own surface shows through everywhere else.
…line A collapsible's trigger is a button, whose default centres a label once it wraps.
…ntegration mark A source that opens nothing used a settings row, whose wider leading slot put its mark 4px off the others; it is now the same row, without the chevron a row that opens nothing has no business showing. Generic Secrets drops the organization's monogram for the mark the Integrations list gives it.
Subscription, Seats, Single sign-on, Sources and tool permissions held bare rows or a heading the loaded page lacks. Home's workspace rows lost their detail line while settling and the activity chart its range control, so the page moved when the read answered. A settling list now marks itself busy.
A touch screen has no tooltip to finish a clipped sentence, so these descriptions wrap, and a picker's value ends in an ellipsis instead of a cut character.
…e's column An empty state sat 8px inside it, a divider ran 8px past it, a text button's label past it on touch, and an account's menu 15px short.
…ed empty state as designed
…into wip/platform-org-wiring # Conflicts: # apps/sim/app/o/[organizationId]/components/organization-conversation-queued-edit.test.tsx # apps/sim/platform/app/(shell)/_components/chat/live/live-chat.tsx # apps/sim/platform/docs/org-parity.md # apps/sim/platform/lib/data/chat.ts
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).