fix(dashboard): scope chat sidebar model card to selected profile (#46665)

* fix(dashboard): scope chat sidebar model card to selected profile

The PTY already honors ?profile= on profile switch, but the JSON-RPC
sidecar created sessions against the dashboard launch profile. Pass the
management profile through session.create and reconnect on switch.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(dashboard): sync active profile with management scope

Align the sidebar switcher with the sticky active profile on load and
when "Set as active" is clicked, so Chat and management pages match
what the Profiles page shows as active.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(dashboard): auto-reconnect chat sidebar on profile switch

Bump the sidecar connection version when profile or PTY channel changes,
matching the manual Reconnect path so gateway and events sockets come
back without clicking the error banner.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(dashboard): prevent model selector chevron overlapping label

Use inline flex layout instead of Button suffix, which is absolutely
positioned and overlapped truncated model names at px-0.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Austin Pickett 2026-06-15 12:50:19 -04:00 committed by GitHub
parent 0bbff1fc7e
commit 0bbf325a8f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 94 additions and 29 deletions

View file

@ -861,7 +861,7 @@ export default function ChatPage({ isActive = true }: { isActive?: boolean }) {
"border-t border-current/10",
)}
>
<ChatSidebar channel={channel} />
<ChatSidebar channel={channel} profile={scopedProfile} />
</div>
</div>
</>,
@ -929,7 +929,7 @@ export default function ChatPage({ isActive = true }: { isActive?: boolean }) {
className="flex min-h-0 shrink-0 flex-col overflow-hidden lg:h-full lg:w-80"
>
<div className="min-h-0 flex-1 overflow-hidden">
<ChatSidebar channel={channel} />
<ChatSidebar channel={channel} profile={scopedProfile} />
</div>
</div>
)}

View file

@ -7,6 +7,7 @@ import {
useState,
} from "react";
import { useNavigate } from "react-router-dom";
import { useProfileScope } from "@/contexts/useProfileScope";
import {
AlignLeft,
Check,
@ -259,6 +260,7 @@ export default function ProfilesPage() {
const { toast, showToast } = useToast();
const { t } = useI18n();
const { setEnd } = usePageHeader();
const { setProfile } = useProfileScope();
// Locale strings with English fallbacks. The enriched keys are optional in
// the i18n type so untranslated locales don't break the build — they render
@ -305,7 +307,7 @@ export default function ProfilesPage() {
manageSkills: p.manageSkills ?? "Manage skills & tools",
activeSetHint:
p.activeSetHint ??
"Applies to new CLI/gateway runs. This dashboard still manages its own profile — use “Manage skills & tools” to edit {name}.",
"Dashboard switched to manage {name}. New CLI/gateway runs will use this profile too.",
};
}, [t.profiles]);
@ -495,10 +497,7 @@ export default function ProfilesPage() {
// The backend normalizes/validates the name; trust the canonical
// value it returns rather than the raw input.
const { active } = await api.setActiveProfile(name);
// "Set as active" only flips the sticky default for FUTURE CLI/gateway
// invocations — it does NOT retarget this running dashboard. Say so,
// or users assume skill/tool toggles now apply to the activated
// profile (they don't — that's what "Manage skills & tools" is for).
setProfile(active);
showToast(
`${L.activeSet}: ${active}${L.activeSetHint.replace("{name}", active)}`,
"success",