Skip to content

fix(settings): split usage-limit settings types to keep global-settings-types under max-lines - #46509

Merged
nwparker merged 1 commit into
mainfrom
bugbash/main-fix-global-settings-max-lines
Nov 21, 2026
Merged

nwparker merged 1 commit into
mainfrom
bugbash/main-fix-global-settings-max-lines

Conversation

@nwparker

@nwparker nwparker commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

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.

Files Added Deleted Net
Test 0 0 0 0
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​12 $\color{#cf222e}{\Huge{\mathbf{−}}}$​14 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2

What Changed

  • nativeChatAutoContinueAfterUsageLimit and nativeChatAutoContinueAfterUsageLimitDefaultedOn are now declared in NativeChatUsageLimitAutoContinueSettings in src/shared/native-chat/settings/native-chat-usage-limit-auto-continue.ts. That module already holds their default-on normalization.
  • GlobalSettingsBase composes that type, the same way it composes NativeChatIdleStopSettings and the other settings groups owned by feature modules. So GlobalSettings still has both fields with the same optional boolean types, and no callers change.
  • The module no longer derives its type with Pick<GlobalSettings, ...>, which also removes its import back into global-settings-types.ts.

Before: global-settings-types.ts was at 301 counted lines and oxlint reported max-lines (limit 300). After: 299 counted lines, and lint passes.

Why

ed0fdf4 (#45410) added the one-shot ...DefaultedOn guard 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 pattern GlobalSettingsBase already 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 oxlint on the three touched files passes. Running it on the original file still reports max-lines (301).
  • pnpm exec oxfmt --check on the touched files passes.
  • pnpm run tc:node, pnpm run tc:web, and pnpm run tc:cli pass.
  • vitest run src/main/persistence/preferences/persistence-usage-limit-auto-continue-default.test.ts passes.
  • No tests added: this is a types-only move with no runtime change.

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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Types only, so there is no security, cross-platform, SSH, mobile, or compatibility impact.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…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.
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds NativeChatUsageLimitAutoContinueSettings with optional auto-continue and defaulted-on stamp fields. The normalizer now uses this type in its parameter and return signatures. GlobalSettingsBase includes the new type, and the two fields are removed from GlobalSettings.

Merge Risk: Minimal · up to 3456a

This is a type-level reorganization with no runtime behavior change. It is low risk and ready to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: splitting usage-limit settings types so global-settings-types stays under the max-lines lint limit. It uses the fix(settings) convention. It matches the changeset and …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the template's main sections (ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, Checklist) and explains the change: moving two settings declarati…
Full details: Title check

Explanation

The title names the main change: splitting usage-limit settings types so global-settings-types stays under the max-lines lint limit. It uses the fix(settings) convention. It matches the changeset and objectives, so it passes.

Full details: Description check

Explanation

The description follows the template's main sections (ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, Checklist) and explains the change: moving two settings declarations into the module that already normalizes them to fix a max-lines lint failure on global-settings-types.ts. Gaps: no linked issue (the template requires one for outside contributors; the author cites PR #45410 as the cause, not an issue), the Risk level is given but the revert note is brief, the Testing section lists no platforms, the Review and AI Disclosure sections are empty, and the final lint/typecheck/test/build checklist item is unchecked. The author also says the file dropped to 299 counted lines while the PR objectives say 297, a discrepancy worth confirming.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8ec00290-b614-4a59-ae7d-7d92d7276914
Commits

Reviewing files that changed from the base of the PR and between f2be607 and 3456a9b.

Files selected for processing: 3

  • src/shared/native-chat/settings/native-chat-usage-limit-auto-continue.ts
  • src/shared/settings/global-settings-base.ts
  • src/shared/settings/global-settings-types.ts
Files with no reviewable changes: 1

  • src/shared/settings/global-settings-types.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@nwparker
nwparker merged commit be7d52a into main Nov 21, 2026
65 of 66 checks passed
@nwparker
nwparker deleted the bugbash/main-fix-global-settings-max-lines branch November 21, 2026 21:04
raymondmuller added a commit to raymondmuller/orca that referenced this pull request Nov 23, 2026
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>
morvy added a commit to morvy/orca that referenced this pull request Nov 25, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant