From 09bd682bad06693d997731c1fa99882a8815b295 Mon Sep 17 00:00:00 2001 From: kratofl <72558571+kratofl@users.noreply.github.com> Date: Wed, 16 Sep 2026 17:34:29 +0200 Subject: [PATCH] fix(web): show the context window meter by default and keep it a normal setting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #9190 moved the composer's context window indicator into "Legacy features", off by default, without a stated reason. Users read the label as a deprecation and asked for it back in that PR's thread and in #9352. Seeing current context occupancy is how people decide when to compact or start a new thread. The toggle now defaults on and sits in Settings → General with the other composer options, with a reset button like its neighbours. An explicit opt-out is preserved. Co-Authored-By: Claude Fable 5.1 --- .../settings/DesktopClientSettings.test.ts | 2 +- .../components/settings/SettingsPanels.tsx | 43 ++++++++++++------- .../settings/settingsSearch.test.ts | 2 +- .../src/components/settings/settingsSearch.ts | 12 +++--- packages/contracts/src/settings.test.ts | 12 +++--- packages/contracts/src/settings.ts | 6 +-- 6 files changed, 45 insertions(+), 32 deletions(-) diff --git a/apps/desktop/src/settings/DesktopClientSettings.test.ts b/apps/desktop/src/settings/DesktopClientSettings.test.ts index 53044dcf7e5d..01b8f6a25444 100644 --- a/apps/desktop/src/settings/DesktopClientSettings.test.ts +++ b/apps/desktop/src/settings/DesktopClientSettings.test.ts @@ -33,7 +33,7 @@ const clientSettings: ClientSettings = { confirmThreadArchive: true, confirmThreadDelete: false, confirmThreadUnpin: false, - contextWindowMeterEnabled: false, + contextWindowMeterEnabled: true, composerCollapseOnScroll: true, dismissedProviderUpdateNotificationKeys: [], diffFilesCollapsed: true, diff --git a/apps/web/src/components/settings/SettingsPanels.tsx b/apps/web/src/components/settings/SettingsPanels.tsx index 5238cf19e190..dbac3da9a983 100644 --- a/apps/web/src/components/settings/SettingsPanels.tsx +++ b/apps/web/src/components/settings/SettingsPanels.tsx @@ -751,9 +751,9 @@ export function useSettingsRestore(onRestored?: () => void) { diffLayout: DEFAULT_UNIFIED_SETTINGS.diffLayout, proactivePanelsEnabled: DEFAULT_UNIFIED_SETTINGS.proactivePanelsEnabled, showSkillsInSlashMenu: DEFAULT_UNIFIED_SETTINGS.showSkillsInSlashMenu, + contextWindowMeterEnabled: DEFAULT_UNIFIED_SETTINGS.contextWindowMeterEnabled, composerCollapseOnScroll: DEFAULT_UNIFIED_SETTINGS.composerCollapseOnScroll, followUpBehavior: DEFAULT_UNIFIED_SETTINGS.followUpBehavior, - contextWindowMeterEnabled: DEFAULT_UNIFIED_SETTINGS.contextWindowMeterEnabled, environmentIdentificationMode: DEFAULT_UNIFIED_SETTINGS.environmentIdentificationMode, glassOpacity: DEFAULT_UNIFIED_SETTINGS.glassOpacity, panelAnimationDurationMs: DEFAULT_UNIFIED_SETTINGS.panelAnimationDurationMs, @@ -1997,7 +1997,6 @@ function AutoSettleDaysInput({ // expand the section before its target can mount and scroll. const LEGACY_FEATURE_TARGET_IDS: ReadonlySet = new Set([ "legacy-plan-mode", - "legacy-context-window-indicator", "legacy-sidebar", ]); @@ -2052,19 +2051,6 @@ function LegacyFeaturesSection() { /> } /> - - updateSettings({ contextWindowMeterEnabled: Boolean(checked) }) - } - aria-label="Context window indicator (legacy)" - /> - } - /> + + updateSettings({ + contextWindowMeterEnabled: DEFAULT_UNIFIED_SETTINGS.contextWindowMeterEnabled, + }) + } + /> + ) : null + } + control={ + + updateSettings({ contextWindowMeterEnabled: Boolean(checked) }) + } + aria-label="Context window indicator" + /> + } + /> + { const streaming = getSettingsSearchTargetScope("response-streaming")!; expect(streaming.scope).toBe("project-defaults"); expect(isSettingsSearchScopeAvailable(streaming.scope, "project")).toBe(true); - for (const id of ["legacy-plan-mode", "legacy-context-window-indicator", "legacy-sidebar"]) { + for (const id of ["legacy-plan-mode", "legacy-sidebar"]) { expect(getSettingsSearchTargetScope(id)!.scope).toBeNull(); } }); diff --git a/apps/web/src/components/settings/settingsSearch.ts b/apps/web/src/components/settings/settingsSearch.ts index 7e999417f2a8..2af67600613d 100644 --- a/apps/web/src/components/settings/settingsSearch.ts +++ b/apps/web/src/components/settings/settingsSearch.ts @@ -292,6 +292,12 @@ export const SETTINGS_SEARCH_ITEMS = [ to: "/settings/general", searchTerms: ["command menu dollar $ slash /"], }, + { + id: "context-window-indicator", + title: "Context window indicator", + to: "/settings/general", + searchTerms: ["composer meter usage tokens circle percent"], + }, { id: "composer-collapse", title: "Collapse composer on scroll", @@ -399,12 +405,6 @@ export const SETTINGS_SEARCH_ITEMS = [ to: "/settings/general", searchTerms: ["build plan composer old"], }, - { - id: "legacy-context-window-indicator", - title: "Context window indicator (legacy)", - to: "/settings/general", - searchTerms: ["composer meter usage tokens circle old"], - }, { id: "legacy-sidebar", title: "Sidebar (legacy)", diff --git a/packages/contracts/src/settings.test.ts b/packages/contracts/src/settings.test.ts index ba612edaf26b..221b910a256c 100644 --- a/packages/contracts/src/settings.test.ts +++ b/packages/contracts/src/settings.test.ts @@ -518,14 +518,14 @@ describe("ClientSettings sidebar", () => { }); describe("ClientSettings context window meter", () => { - it("defaults off and preserves an explicit legacy opt-in", () => { - expect(decodeClientSettings({}).contextWindowMeterEnabled).toBe(false); + it("defaults on and preserves an explicit opt-out", () => { + expect(decodeClientSettings({}).contextWindowMeterEnabled).toBe(true); expect( - decodeClientSettings({ contextWindowMeterEnabled: true }).contextWindowMeterEnabled, - ).toBe(true); + decodeClientSettings({ contextWindowMeterEnabled: false }).contextWindowMeterEnabled, + ).toBe(false); expect( - decodeClientSettingsPatch({ contextWindowMeterEnabled: true }).contextWindowMeterEnabled, - ).toBe(true); + decodeClientSettingsPatch({ contextWindowMeterEnabled: false }).contextWindowMeterEnabled, + ).toBe(false); }); }); diff --git a/packages/contracts/src/settings.ts b/packages/contracts/src/settings.ts index 1c53b36037ba..4b5cef8a5104 100644 --- a/packages/contracts/src/settings.ts +++ b/packages/contracts/src/settings.ts @@ -424,9 +424,9 @@ export const ClientSettingsSchema = Schema.Struct({ // default UI; this beta flag restores it (plus the /plan and /default slash // commands) for users who still rely on the old workflow. planModeEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))), - // Legacy context window meter. The composer hides it by default; users who - // still want the old usage indicator can restore it from Settings. - contextWindowMeterEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))), + // Context window meter in the composer footer. On by default; users who + // prefer a cleaner composer can switch it off from Settings → General. + contextWindowMeterEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))), // Desktop resting composer: scrolling an existing thread's conversation // settles the composer into its single-line layout. Losing focus never does. composerCollapseOnScroll: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(true))),