The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(desktop): appearance extras use the pane boundary and render on the top-level page only
teknium155c52f290279
diff --git a/apps/desktop/src/app/settings/appearance-contrib.test.tsx b/apps/desktop/src/app/settings/appearance-contrib.test.tsxindex 9eb8f355bb7..0c546c9f399 100644--- a/apps/desktop/src/app/settings/appearance-contrib.test.tsx+++ b/apps/desktop/src/app/settings/appearance-contrib.test.tsx@@ -60,7 +60,9 @@ describe('AppearanceExtraSlot', () => {render(<AppearanceExtraSlot />)- // The boundary's inline fallback names the failed contribution.- expect(screen.getByRole('button', { name: 'broken-extra' })).toBeTruthy()+ // A page-level card gets the pane fallback (canonical ErrorState + Retry),+ // not the bar-item chip meant for toolbar slots.+ expect(screen.getByText('“broken-extra” failed to render')).toBeTruthy()+ expect(screen.getByRole('button', { name: /retry/i })).toBeTruthy()})})diff --git a/apps/desktop/src/app/settings/appearance-contrib.tsx b/apps/desktop/src/app/settings/appearance-contrib.tsxindex 78064146908..650321e5c05 100644--- a/apps/desktop/src/app/settings/appearance-contrib.tsx+++ b/apps/desktop/src/app/settings/appearance-contrib.tsx@@ -28,7 +28,7 @@ export function AppearanceExtraSlot() {return (<>{contributions.map(contribution => (- <ContribBoundary id={contribution.id} key={`${contribution.source ?? 'core'}:${contribution.id}`} variant="chip">+ <ContribBoundary id={contribution.id} key={`${contribution.source ?? 'core'}:${contribution.id}`}>{contribution.render && <ContribRender render={contribution.render} />}</ContribBoundary>))}diff --git a/apps/desktop/src/app/settings/appearance-settings.extra-slot.test.tsx b/apps/desktop/src/app/settings/appearance-settings.extra-slot.test.tsxnew file mode 100644index 00000000000..d19acfc5f6e--- /dev/null+++ b/apps/desktop/src/app/settings/appearance-settings.extra-slot.test.tsx@@ -0,0 +1,48 @@+// @vitest-environment jsdom+import { QueryClient, QueryClientProvider } from '@tanstack/react-query'+import { act, cleanup, render, screen } from '@testing-library/react'+import { afterEach, describe, expect, it } from 'vitest'++import { registry } from '@/contrib/registry'++import { APPEARANCE_AREAS } from './appearance-contrib'+import { AppearanceSettings } from './appearance-settings'++const disposers: Array<() => void> = []++afterEach(() => {+ cleanup()+ disposers.splice(0).forEach(dispose => dispose())+})++function renderPage(subpage?: string) {+ return render(+ <QueryClientProvider client={new QueryClient()}>+ <AppearanceSettings subpage={subpage} />+ </QueryClientProvider>+ )+}++describe('AppearanceSettings extra slot', () => {+ it('mounts plugin extras on the top-level page only, not on deep-link subpages', () => {+ act(() => {+ disposers.push(+ registry.register({+ area: APPEARANCE_AREAS.extra,+ id: 'extra-controls',+ render: () => <span>Extra controls</span>,+ source: 'disk'+ })+ )+ })++ const { unmount } = renderPage('pet')++ expect(screen.queryByText('Extra controls')).toBeNull()+ unmount()++ renderPage()++ expect(screen.getByText('Extra controls')).toBeTruthy()+ })+})diff --git a/apps/desktop/src/app/settings/appearance-settings.tsx b/apps/desktop/src/app/settings/appearance-settings.tsxindex 95d6b98e902..30d5a6cf812 100644--- a/apps/desktop/src/app/settings/appearance-settings.tsx+++ b/apps/desktop/src/app/settings/appearance-settings.tsx@@ -1053,9 +1053,10 @@ export function AppearanceSettings({ subpage }: AppearanceSettingsProps = {}) {)}{/* Plugin-provided appearance controls — the sanctioned seam for a- plugin that used to inject nodes into this page. Not a setting- section: the subpage filter above does not gate it. */}- <AppearanceExtraSlot />+ plugin that used to inject nodes into this page. Top-level page only:+ a deep-link subpage shows one built-in section, and a plugin card is+ not that section. */}+ {subpage === undefined && <AppearanceExtraSlot />}</SettingsContent>)}diff --git a/website/docs/developer-guide/desktop-plugin-sdk.md b/website/docs/developer-guide/desktop-plugin-sdk.mdindex 0a318b14985..dfdb3846554 100644--- a/website/docs/developer-guide/desktop-plugin-sdk.md+++ b/website/docs/developer-guide/desktop-plugin-sdk.md@@ -655,11 +655,11 @@ ctx.register({```*Arbitration:* every registration mounts, in registry order, each inside its-own error boundary — a contribution that throws collapses to an inline chip-naming its `id` and the rest of the page (and other plugins' cards) keep-rendering. The slot is not a settings section: the Appearance subpage filter-does not gate it, and there is no "first wins" — plugins cannot suppress each-other here.+own error boundary — a contribution that throws collapses to an inline error+card naming its `id` (with Retry) and the rest of the page (and other plugins'+cards) keep rendering. The slot mounts on the top-level Appearance page only,+not on deep-link subpages (`settings/appearance/<section>`), and there is no+"first wins" — plugins cannot suppress each other here.*Teardown:* the registration is owned by the plugin loader; disabling orreloading the plugin disposes it and the card disappears on the next render.