Repository navigation
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 16 minutes. View limit details
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. Comment |
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
This PR simplifies the frontend (lane D of the simplification program) and should not change behavior. It lands audit levers FE-01 to FE-11 and FE-13, and splits six godfiles so each piece is under 800 lines. Persisted formats, DTO shapes, settings tab ids and user-facing strings do not change.
SettingsSnapshotfixture, rate-window and usage-snapshot builders, and locale/eventvi.mockfactoriesmergeValidCurrencyRates,FALLBACK_CURRENCY_RATES,MenuSummary,providerDisplayDetailTitle,paceCategoryKeylib/tauri.tsimport.meta.glob, and registry ids are derived from the icon tablekeys.ts,rust/src/locale.rsand all 10.ftlfilesSettingToggleandSettingSelectrows (32 toggles, 12 selects)useCodexAccountsState)useTauriEventhook for plain event subscriptions*rule, and deletes 51 base declarations that tray-qualified rules always overrideGodfile splits:
styles.css@importlist of 9 per-surface stylesheets undersrc/styles/, in the original cascade order (largest 772 lines).test/styles.tsinlines the imports.i18n/keys.tsi18n/keyGroups/{core,shell,providerText}.ts, spread intoALL_LOCALE_KEYSin the original key ordertypes/bridge.tstypes/bridge/{settings,usage,providers,codexAccounts}.ts, with DTO text unchanged. One commit first drops the second, identicalProviderSummarydeclaration.TrayPanel.test.tsx,MenuCard.test.tsx,FloatBar.test.tsxsrc/test/check-locale script change.
scripts/check-locale-drift.mjsnow resolves the...TOPIC_KEYSspreads inALL_LOCALE_KEYS: it follows each spread's import inkeys.tsand reads the array from that topic file. It still exits 1 on drift. I proved this by adding a fake keyFakeDriftProbeKeytokeyGroups/providerText.ts, which failed withDRIFT DETECTED rust=1199 ts=1200, and then reverting it.LOC (loc.py, HEAD vs origin/main 3226d2f)
loc.py counts
src/test/*as prod. The six new harness and mocks modules hold test code that moved out of the three split test files, and they add 676 raw lines to that bucket. With them counted as test, the raw delta is -2149 prod and -604 test.Test inventory
MenuSummary×2,providerDisplayDetailTitle×1 andpaceCategory×1. Before the split, after the split and in the final tree, the case names match exactly, ignoring file paths.cargo test -- --listoutput contains every name in the before list.Commands
pnpm exec tsc --noEmit -p .pnpm exec vitest runpnpm run lint(oxlint)pnpm run buildpnpm run check-localecargo fmt --allcargo clippy --workspace --all-targets -- -D warningscargo test -p codexbarcargo test -p codexbar-desktop-tauriscripts/local-check.ps1 -Slice ciBehavior-risk notes
useTauriEventdrops events that arrive after cleanup whilelistenis still resolving. Before, thesettings-changedhandler could still run in that window.onLayoutChangeeffect.ProviderSummary: the deleted declaration was identical to the one kept, so the type is unchanged.loadingand actionactingare now separate flags. Before, acodex-accounts-updatedreload that finished mid-action re-enabled the buttons, so a second action could start concurrently. Now the buttons stay disabled until both finish.Proof
Debug desktop builds of origin/main 3226d2f and this branch 14ade1c, captured with the proof kit; windows ran on the secondary monitor. The logs are under
W:\pstack-logs\Win-CodexBar\simplify\laneD\. Run directories are under%LOCALAPPDATA%\Win-CodexBar\port-audit\proof-kit\runs\.styledump.py): every element's computed style and the DOM in 200 states (tray panel, every Settings tab, every provider detail pane and the float bar, in dark and light).style-diff-after.txt). All are explained intray-inline-proof.txt:provider-11: a seeded credentials path holds the run directory name, which wraps differently.suite.py+report.py, with the CUA driver daemon running):runs\suite-20261010-145829\report.html, 445 ok, 0 FAIL, 14 info.runs\suite-20261010-151131\report.html, 445 ok, 0 FAIL, 14 info. The sorted list of result names (values removed) matches the before run exactly. Logs:laneD\suite-before2.logandlaneD\suite-after2.log.Follow-ups (not in this PR)
useTrayPanelLayout: overlapping auto-fit runs leave measurement inline styles on the tray panel.AccountRow, because the row markup differs.get_spend_contract,get_codex_workspaces_snapshot,codex_accounts_listandcodex_account_snapshotsno longer have a frontend caller, and theget_provider_catalogcommand registration is orphaned too (Rust still calls the function internally).localizeProviderLabel. This PR deletes the deadproviderDisplayDetailTitlehelper and itsAtlasCloudAvailableBalancekey, so a later fix adds a mapping tolocalizeProviderLabelplus the key again.