Skip to content

Commit 061427d

Browse files
levochkaaclaude
andcommitted
feat(web): add a setting to share the right panel width across threads
The inline right panel remembers its width per thread, so anyone who keeps it at one size has to resize it again in every thread. Add an opt-in Appearance setting, Shared panel width, that stores one width for all threads. It is off by default, so per-thread widths keep working as before. Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 774c6c1 commit 061427d

5 files changed

Lines changed: 42 additions & 1 deletion

File tree

‎apps/web/src/components/ChatView.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,10 @@ export default function ChatView(props: ChatViewProps) {
16661666
const browserAvailable = isPreviewSupportedInRuntime() || activeEnvironmentServerBrowser;
16671667
const previewPanelInlineSize = usePreviewPanelInlineSize(undefined, {
16681668
container: workspaceLayoutElement,
1669-
widthStorageKey: `t3code:preview-panel-width:${activeThreadKey}`,
1669+
// `undefined` selects the hook's single app-wide key.
1670+
widthStorageKey: settings.sharedPanelWidth
1671+
? undefined
1672+
: `t3code:preview-panel-width:${activeThreadKey}`,
16701673
});
16711674
const activeThreadShell = serverThread;
16721675
const timelineThreadError =

‎apps/web/src/components/settings/SettingsPanels.tsx‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,9 @@ export function useSettingsRestore(onRestored?: () => void) {
595595
DEFAULT_UNIFIED_SETTINGS.persistComposerContextStrip
596596
? ["Composer context"]
597597
: []),
598+
...(settings.sharedPanelWidth !== DEFAULT_UNIFIED_SETTINGS.sharedPanelWidth
599+
? ["Shared panel width"]
600+
: []),
598601
...getChangedTypographySettingLabels(settings),
599602
...(settings.diffFilesCollapsed !== DEFAULT_UNIFIED_SETTINGS.diffFilesCollapsed
600603
? ["Default diff file state"]
@@ -726,6 +729,7 @@ export function useSettingsRestore(onRestored?: () => void) {
726729
inAppNotificationsEnabled: DEFAULT_UNIFIED_SETTINGS.inAppNotificationsEnabled,
727730
wordWrap: DEFAULT_UNIFIED_SETTINGS.wordWrap,
728731
persistComposerContextStrip: DEFAULT_UNIFIED_SETTINGS.persistComposerContextStrip,
732+
sharedPanelWidth: DEFAULT_UNIFIED_SETTINGS.sharedPanelWidth,
729733
diffFilesCollapsed: DEFAULT_UNIFIED_SETTINGS.diffFilesCollapsed,
730734
diffIgnoreWhitespace: DEFAULT_UNIFIED_SETTINGS.diffIgnoreWhitespace,
731735
diffLayout: DEFAULT_UNIFIED_SETTINGS.diffLayout,
@@ -1346,6 +1350,28 @@ export function AppearanceSettingsPanel() {
13461350
}
13471351
/>
13481352

1353+
<SettingsRow
1354+
{...searchableSetting("shared-panel-width")}
1355+
description="Use one right panel width in every thread. When off, each thread keeps its own width."
1356+
resetAction={
1357+
settings.sharedPanelWidth !== DEFAULT_UNIFIED_SETTINGS.sharedPanelWidth ? (
1358+
<SettingResetButton
1359+
label="shared panel width"
1360+
onClick={() =>
1361+
updateSettings({ sharedPanelWidth: DEFAULT_UNIFIED_SETTINGS.sharedPanelWidth })
1362+
}
1363+
/>
1364+
) : null
1365+
}
1366+
control={
1367+
<Switch
1368+
checked={settings.sharedPanelWidth}
1369+
onCheckedChange={(checked) => updateSettings({ sharedPanelWidth: Boolean(checked) })}
1370+
aria-label="Use the same right panel width in every thread"
1371+
/>
1372+
}
1373+
/>
1374+
13491375
<SettingsRow
13501376
{...searchableSetting("chat-width")}
13511377
description="Set how wide messages and the composer can grow on large screens."

‎apps/web/src/components/settings/settingsSearch.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ describe("searchSettings", () => {
331331
id: "composer-context",
332332
to: "/settings/appearance",
333333
});
334+
expect(searchSettings("panel width")[0]).toMatchObject({
335+
id: "shared-panel-width",
336+
to: "/settings/appearance",
337+
});
334338
expect(searchSettings("environment identification")[0]).toMatchObject({
335339
id: "environment-identification",
336340
to: "/settings/appearance",

‎apps/web/src/components/settings/settingsSearch.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,12 @@ export const SETTINGS_SEARCH_ITEMS = [
298298
title: "Composer context",
299299
to: "/settings/appearance",
300300
},
301+
{
302+
id: "shared-panel-width",
303+
title: "Shared panel width",
304+
to: "/settings/appearance",
305+
searchTerms: ["right side panel diff changes browser resize size every all threads"],
306+
},
301307
{
302308
id: "project-grouping",
303309
title: "Project grouping",

‎packages/contracts/src/settings.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ export const ClientSettingsSchema = Schema.Struct({
418418
persistComposerContextStrip: Schema.Boolean.pipe(
419419
Schema.withDecodingDefault(Effect.succeed(false)),
420420
),
421+
sharedPanelWidth: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
421422

422423
favorites: ModelFavorites.pipe(Schema.withDecodingDefault(Effect.succeed([]))),
423424
providerModelPreferences: ProviderModelPreferences.pipe(
@@ -1624,6 +1625,7 @@ export const ClientSettingsPatch = Schema.Struct({
16241625
fontFamilyTerminal: Schema.optionalKey(FontFamilyPreference),
16251626
fontSmoothing: Schema.optionalKey(Schema.Boolean),
16261627
persistComposerContextStrip: Schema.optionalKey(Schema.Boolean),
1628+
sharedPanelWidth: Schema.optionalKey(Schema.Boolean),
16271629
favorites: Schema.optionalKey(ModelFavorites),
16281630
providerModelPreferences: Schema.optionalKey(ProviderModelPreferences),
16291631
pullRequestMergeMethodOverrides: Schema.optionalKey(

0 commit comments

Comments
 (0)