fix(renderer): restore quality gate baseline - #1264
Open
SunwardL wants to merge 1 commit into
Open
Conversation
SunwardL
force-pushed
the
codex/fix-background-shell-ansi-lint
branch
from
September 3, 2026 03:24
0b83849 to
ff1e1ed
Compare
This was referenced Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 概要
Restore the renderer quality-gate baseline on the current
developbranch by fixing two independent stale representations:UsageQuotaPaneltest expectations with the new fixed 12-week daily-history design.恢复当前
develop的 renderer 质量门禁基线:一项修复 lint 表达方式,另一项修复 Usage 12 周历史重构后遗漏更新的测试断言。Why / 背景
1. Intentional ANSI matching triggered
no-control-regexstripAnsiSequences()intentionally matches ESC (U+001B) so terminal color and control sequences are removed before background-shell output is rendered.The previous regex literal was functionally correct, but ESLint's
no-control-regexrule rejects control characters written in regex literals. This caused the fullnpm run lintquality gate to fail even though the runtime behavior was correct.The pattern is now constructed with
new RegExp()andString.fromCharCode(27), following the existing convention insrc/main/claude-subscription-auth.ts. The pattern branches and global matching behavior remain unchanged.2. The 12-week Usage history refactor left stale range assertions
Upstream commit
586283f3introducedSidebarUsageHistoryCardand intentionally changed daily usage loading to a fixedHISTORY_RANGE_DAYS = 84, allowing the card to render 12 weeks × 7 days.The range selector now has two distinct responsibilities:
7d,30d,90d, orallrange.The existing
UsageQuotaPanel.test.tsstill expected both requests to follow the selector. The first #1264 quality-gate run therefore failed at the daily-range assertion with:expected 84 to be 7This was a deterministic stale-test failure in the current base rather than a runtime regression caused by the ANSI change.
Failure evidence:
https://github.com/KunAgent/Kun/actions/runs/33708795909/job/100503661816?pr=1264
Changes / 变更
RegExpconstruction.Media / 截图或录屏
Not applicable. There is no visual or interaction change.
Tests / 测试
Focused tests:
BackgroundShellOverlay.test.tsUsageQuotaPanel.test.tsCoverage includes:
Validation / 验证
npm run test— the local full-suite command did not return a conclusive exit code within the available execution window; GitHub Actions is the authoritative full-suite validation.npm run typechecknpm run build— not required because no runtime or packaging behavior changed.npm run dev— not applicable because no runtime/UI behavior changed.npm run lint— passed with 0 errors and 30 pre-existing warnings.git diff --checkNotes / 备注
This PR contains only renderer quality-gate baseline repairs. It remains separate from the Memory/P1 work so the feature PR stays focused.
After CI identified the stale Usage assertion, the original #1264 commit was amended into one clean commit:
ff1e1ed16478c1cd43aba6e1c37f9da15a5ddc39