Skip to content

Isolate DeveloperChat and DashboardChat sidebar state#9393

Draft
ericpgreen2 wants to merge 1 commit intomainfrom
ericgreen/scope-ai-chat-by-surface
Draft

Isolate DeveloperChat and DashboardChat sidebar state#9393
ericpgreen2 wants to merge 1 commit intomainfrom
ericgreen/scope-ai-chat-by-surface

Conversation

@ericpgreen2
Copy link
Copy Markdown
Contributor

@ericpgreen2 ericpgreen2 commented May 6, 2026

Polishing the in-flight cloud editing feature on two fronts:

  1. /-/edit/... should have a single AI surface — the developer agent. Today, viewing a dashboard preview inside the editor mounts both <DeveloperChat /> (root edit layout) and <DashboardChat /> (the /-/edit/explore/[name] wrapper layout), gated on the same chatOpen flag. With both feature flags enabled the user sees two AI panels side-by-side. Removing the dashboard chat in editor routes also moves us toward the future where one Rill Developer AI surface handles both developer and analyst work.
  2. Developer and dashboard chat sidebars should have fully independent state. Open/closed state and conversation ID are now scoped per surface. The motivation is the Publish flow: clicking Publish opens a new prod tab, and Chromium clones sessionStorage to that new tab. Without per-surface scoping, chat-open=true carries over (so the prod sidebar appears open by default) and the dev-runtime conversation ID is loaded against the prod runtime, leading to an "Unable to find this conversation" error.

Implementation:

  • Delete /-/edit/explore/[name]/+layout.svelte, the wrapper that mounted <DashboardChat /> next to the editor's <DeveloperChat />. Suppress the dashboard <ChatToggle /> in ProjectHeader.svelte when editContext is true.
  • Split chatOpen/sidebarActions into per-surface developerChatOpen/developerChatActions and dashboardChatOpen/dashboardChatActions. SidebarChat and ChatToggle now accept the surface's open/actions as props; non-component callers (ExplainAndFixErrorButton, chart-ai-agent, generateCanvas, generate-sample-data, measure-selection, embed public API) wire to their explicit surface.
  • Scope BrowserStorageConversationSelector storage key by surface: sidebar-conversation-id-{surface}-{org}-{project}.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

Developed in collaboration with Claude Code

- Remove the `<DashboardChat />` wrapper in `/-/edit/explore/[name]`
  so editor sub-routes render only the developer agent.
- Split the sidebar store into per-surface `developerChatOpen`/
  `dashboardChatOpen` and `developerChatActions`/`dashboardChatActions`.
  `SidebarChat` and `ChatToggle` now take the surface's actions/open
  as props.
- Scope `BrowserStorageConversationSelector` storage key by surface,
  so a dev-runtime conversation ID does not load against the prod
  runtime when a Publish-spawned tab inherits sessionStorage.
@ericpgreen2 ericpgreen2 self-assigned this May 6, 2026
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.

1 participant