Skip to content

feat(ui): render the chat dock vertically with its own close button - #113

Merged
mattdjenkinson merged 1 commit into
mainfrom
feat/chat-dock-vertical
Oct 1, 2026
Merged

mattdjenkinson merged 1 commit into
mainfrom
feat/chat-dock-vertical

Conversation

@mattdjenkinson

Copy link
Copy Markdown
Contributor

The Patch AI dock is a tall, narrow column, but ChatDock rendered datum-ui's horizontal workspace. Its left rail and history panel squeezed the chat to a sliver, and the portal's dock close button sat on top of the chat header's sidebar toggle.

  • ChatDock renders AssistantWorkspace with orientation="vertical": a top bar (history toggle, title, new chat), history as a drawer over the chat, and a tighter empty state.
  • It passes the dock's onClose through, so the close button sits in the chat's own header.
  • plugin-manifest.json sets handlesClose: true, which tells the portal to drop its overlay button.
  • @datum-cloud/datum-ui moves from ^2.10.0 to ^3.4.0, the release with both props (fix(nav): steady rail motion; feat(assistant): vertical orientation and onClose datum-cloud/datum-ui#228). The plugin only imports datum-ui/assistant, has no type-scale classes to migrate, and its deps already meet 3.x's peers (motion 13, react-table 9, react 19.2.8).

Release order

  1. Let dock widgets render their own close button datum-cloud/cloud-portal#1612 (dock passes onClose, honours handlesClose) must be deployed first. An older portal ignores the flag and keeps its overlay button, which would then cover the chat's new-chat button.
  2. datum-cloud/assistant-chat-kit#2 widens the kit's datum-ui peer range to include 3.x. Until it's released, installs log a peer warning but work.

Test plan

  • bun install, tsc --noEmit, vite build against the published datum-ui 3.4.0
  • Typecheck fails against datum-ui 2.10 and passes against 3.4, so the dependency bump is required
  • In a portal running cloud-portal#1612: open Patch AI from the dock. Check there's a single close button (in the chat header), the history drawer opens and closes, and picking a chat closes the drawer.

The dock is a tall, narrow column, but the chat rendered datum-ui's
horizontal layout: a left rail plus a history panel that squeezed the
chat to a sliver. The portal's dock also overlaid its close button on the
chat header's controls.

ChatDock now renders the workspace with `orientation="vertical"` (top
bar, history drawer) and passes the dock's `onClose` through, so the X
sits in the chat's own header. The manifest declares `handlesClose`, so
the portal drops its overlay button.

Moves @datum-cloud/datum-ui from ^2.10.0 to ^3.4.0, the release that adds
both props. The plugin only imports datum-ui/assistant, and its existing
deps already satisfy 3.x's peers (motion 13, react-table 9).
mattdjenkinson added a commit to datum-cloud/cloud-portal that referenced this pull request Oct 1, 2026
**Problem**
The dock panel puts its close button on top of the widget's top-right
corner. Patch's chat now has a header with its own controls in that
corner (datum-ui 3.4's vertical `AssistantWorkspace`), so the two
buttons sit on top of each other.

**Solution**
Every `portal.dock/project` component is now mounted with an `onClose`
prop. A widget that sets `handlesClose: true` in its manifest renders
its own close control, and the panel then drops its overlay button.
Widgets without the flag keep the overlay, so existing plugins are
unaffected.

- `DockProjectProperties.handlesClose` and `DockWidgetProps` are defined
in `types.ts` and validated in the manifest schema.
- `LazyPluginComponent` forwards optional `componentProps` to the plugin
component.
- The dock's loading skeleton now matches the chat's vertical layout
(top bar and empty state) rather than the old left rail.

`DockWidgetProps` lives here for now. It belongs in
`@datum-cloud/portal-plugin-sdk` eventually, so plugins can import the
type instead of copying it.

**Rollout**
Merge and deploy this before releasing the assistant plugin change that
sets `handlesClose` (milo-os/assistant#113). An older portal ignores the
flag and keeps its overlay button, which would then sit on top of the
chat's new-chat button.

Related: datum-cloud/datum-ui#228

**Test plan**
- [x] `bun run typecheck`, eslint, prettier
- [x] `bun test app/modules/plugins`: 221 pass, including 2 new manifest
schema tests (`handlesClose` accepted, non-boolean rejected)
- [ ] With the updated assistant plugin: the dock shows a single close
button (in the chat header), and it closes the panel
- [ ] A dock widget without `handlesClose` still gets the overlay close
button
@mattdjenkinson
mattdjenkinson merged commit a414bc2 into main Oct 1, 2026
5 checks passed
@mattdjenkinson
mattdjenkinson deleted the feat/chat-dock-vertical branch October 1, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants