fix(webviews): type the find pill's icon map in editor-find-narrow (base type-check red from #22872)

Merged
TE
17d ago
+9-5

webviews/test/editor-find-narrow.test.tsx (from #22872) indexes an inline object literal by role, which widens each icon name to string, so vp check in webviews fails on base 3b0a6b37 with TS2322 ("Type 'string' is not assignable to type 'IconName'") at line 42. This names the map with as const satisfies Record<FindPillIconRole, IconName>, the way find/FindBar.tsx does. The map is inside the requireBrowserLane callback, which check:browser-lanes requires.

Changelog

none

Observed / Not run

  • Observed: scripts/web-lint.sh fails on base with the TS2322 above, and passes on this branch. prepush-gate.py reports no new violations.
  • Not run: the browser test itself (Playwright Chromium lane); CI runs it. Its behavior is unchanged: it draws the same four icons.

Agent session: cosmic-gray

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes the webviews type-check failure by typing the find pill's icon map in editor-find-narrow.test.tsx.

  • Indexing an inline object literal by role widened each icon name to string, causing TS2322 on base (string is not assignable to IconName).
  • Declares the map with as const satisfies Record<FindPillIconRole, IconName>, matching how find/FindBar.tsx does it.
  • Test behavior is unchanged; it renders the same four icons.