Repository navigation
fix(settings): split usage-limit settings types to keep global-settings-types under max-lines - #46509
Conversation
…gs-types under max-lines #45410 pushed src/shared/settings/global-settings-types.ts to 301 counted lines, one over the oxlint max-lines limit, failing lint on main. Move the two usage-limit auto-continue fields into the module that already owns their normalization and compose that type into GlobalSettingsBase, the same way other feature-owned settings groups are composed. Types only.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Keeps the copy-on-write checkouts search entry next to upstream's shared Codex servers filter, and moves the setting's type into its own module (as stablyai#46509 did) since upstream left the settings files at the max-lines limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move getAppearanceAdvancedEntries into appearance-advanced-search.ts and the window title settings into DesktopWindowSettings in global-settings-base.ts, following the split pattern from stablyai#46509.
ELI5
The lint check on main fails because one settings file got one line too long. This moves two settings declarations into the file that already handles them, so the long file fits again. Nothing the app does changes.
What Changed
nativeChatAutoContinueAfterUsageLimitandnativeChatAutoContinueAfterUsageLimitDefaultedOnare now declared inNativeChatUsageLimitAutoContinueSettingsinsrc/shared/native-chat/settings/native-chat-usage-limit-auto-continue.ts. That module already holds their default-on normalization.GlobalSettingsBasecomposes that type, the same way it composesNativeChatIdleStopSettingsand the other settings groups owned by feature modules. SoGlobalSettingsstill has both fields with the same optionalbooleantypes, and no callers change.Pick<GlobalSettings, ...>, which also removes its import back intoglobal-settings-types.ts.Before:
global-settings-types.tswas at 301 counted lines andoxlintreportedmax-lines(limit 300). After: 299 counted lines, and lint passes.Why
ed0fdf4 (#45410) added the one-shot
...DefaultedOnguard field and pushed the file over the limit. Every PR now fails lint. Raising the limit or adding a disable comment would just hide the size problem. Moving the usage-limit pair next to the code that normalizes it follows the patternGlobalSettingsBasealready uses.Linked Issue
No issue. This fixes the main lint break from #45410 (
src/shared/settings/global-settings-types.ts:514:2: File has too many lines (301)).Visual Proof
N/A. This only moves type declarations, so nothing visible or interactive changes.
Testing
pnpm exec oxlinton the three touched files passes. Running it on the original file still reportsmax-lines (301).pnpm exec oxfmt --checkon the touched files passes.pnpm run tc:node,pnpm run tc:web, andpnpm run tc:clipass.vitest run src/main/persistence/preferences/persistence-usage-limit-auto-continue-default.test.tspasses.Performance
None, because this only moves type declarations.
Risk
The only possible problem is a type-level one, such as a field going missing from
GlobalSettings, and the typechecks rule that out. Nothing changes in saved settings, IPC, SSH, or mobile. A plain revert backs it out.Level: Low
AI Disclosure
Review
Agent skill upstream boundary
Notes
Types only, so there is no security, cross-platform, SSH, mobile, or compatibility impact.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)