Repository navigation
fix: restore main's lint and localization checks (split bot-items-runtime, drop stale item menu keys) - #51478
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…main #51417 moved bots.items.menu.cancel/done to bots.items.row.*, while the fr/es/ja/zh-Hant desktop translation PRs merged with the old keys. The catalog verifier now fails on main with 'extra' keys. Remove the stale pair and carry each locale's existing Cancel translation to bots.items.row.cancel.
Pure move refactor that fixes the main lint break caused by #49402: oxlint's
max-linesrule (300 non-blank, non-comment lines) failed onsrc/main/bots/bot-items-runtime.tsat 310, which breaks every open PR's static analysis job.ELI5
One file got a little too long for the lint rule. This PR moves one self-contained chunk, the code that turns stored bot items into what the UI shows, into its own file. Nothing behaves differently.
What Changed
src/main/bots/bot-item-views.tsholdsbotItemViewsFromRows(previously the privateBotItemsHost.viewsFromRowsmethod). The body is moved verbatim.this.join,this.deps.bots()andthis.owningChat(item)becomedeps.join,deps.bots()anddeps.owningChat(item)through a smallBotItemViewDepsobject.BotItemsHost.viewsandBotItemsHost.showViewnow callbotItemViewsFromRows(this.viewDeps(), ...). The new privateviewDeps()passes the same join, bots and owning-chat lookups.botsis still read lazily after the worker read, the same as before.botItemEventId,botItemQuestionView) moved with it.BotItemsHost,BotItemsHostDepsandwarnstill come frombot-items-runtime, so no importers changed.Line counts for
bot-items-runtime.ts(counted the way the lint rule counts them):Why
mainfailspnpm exec oxlinton this file, so every PR's static analysis job fails. This brings the file back under the limit without disabling the rule or changing behavior.Verification
pnpm exec oxlint src/main/bots: cleanpnpm exec oxfmt --checkon both touched files: cleanpnpm run typecheck:node: passespnpm exec vitest run src/main/bots:bot-items-runtime.test.tsand the other bots suites pass. The only failures are insharing/bot-package-archive.test.ts, which fails the same way on unmodifiedorigin/mainin this environment because no system keyring is available.Also fixes: stale item menu keys (from #51485)
#51417 moved
bots.items.menu.cancel/donetobots.items.row.*, but the fr/es/ja/zh-Hant translation PRs merged with the old keys, soverify-localization-catalogs.mjsfails on main withextrakeys. This PR removes the stale pair from those 4 locales and carries each locale's existing Cancel translation over tobots.items.row.cancel. The two fixes share one PR because each would fail CI on the other's break.Performance
No runtime change. The refactor is a pure move:
botItemViewsFromRowsruns the same code, plus one small deps object perviews/showViewcall, which is negligible next to the store reads it wraps. The locale change only edits keys. No new I/O, polling, subscriptions or hot-path work.