Skip to content

icon2 cleanup#28998

Merged
chrisnojima merged 20 commits intonojima/HOTPOT-next-670-cleanfrom
nojima/HOTPOT-icon2-cleanup
Mar 7, 2026
Merged

icon2 cleanup#28998
chrisnojima merged 20 commits intonojima/HOTPOT-next-670-cleanfrom
nojima/HOTPOT-icon2-cleanup

Conversation

@chrisnojima
Copy link
Contributor

No description provided.

chrisnojima and others added 8 commits March 7, 2026 08:12
- Add onClick, className, padding, Huge/Bigger sizes to Icon2
- Create ImageIcon component for image icons (icon-* types)
- Export ImageIcon from common-adapters barrel
- Migrate 17 files from Kb.Icon to Kb.Icon2/ImageIcon
- search.tsx, jump-to-recent.tsx, reply-preview.tsx, command-status.tsx
- retention-notice.tsx, special-top-message.tsx
- no-conversation.tsx, you-are-reset.tsx, delete-history-warning.tsx
- reset-user.tsx, announcement.tsx
~40 files: chat cards, emoji picker, audio, payments, inbox rows,
team confirm modals, add-members wizard, emojis, channel header,
login/signup flows
…, teams, crypto, devices, wallets, unlock-folders)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…am-building, menubar, settings, router)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ch 6)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…assName to ImageIcon

- IconAuto checks iconMeta[type].isFont at runtime and renders Icon2 or ImageIcon
- Added className prop to ImageIcon (plumbed to <img> on desktop)
- Migrated all remaining dynamic-type Icon usages to IconAuto
- Fixed start-new-chat hoverColor="inital" (typo, no-op on mobile) → Icon2
…phase)

- Added hoverColor prop to Icon2 (desktop: CSS class hover_color_*, native: ignored)
- Migrated 5 hoverColor files: banner, popup-dialog, check-circle, checkbox, search-filter
- Migrated 3 boxStyle files: search-filter (merged into style), checkbox (wrapped in Box2), name-with-icon (wrapped in Box2)
- Migrated 4 dynamic-type files to IconAuto: meta, input3.desktop, input3.native, platform-icon
- Zero remaining `import Icon from './icon'` or `<Kb.Icon` usages
@chrisnojima chrisnojima changed the title IP: icon2 cleanup WIP: icon2 cleanup Mar 7, 2026
…ure black

The old Icon component defaulted to globalColors.black_50 when no color
was specified. Icon2 was missing this default, causing icons to render
as pure black instead of the themed gray.
- Remove gridSize from Icon2 size calculation (old Icon never used
  gridSize for font size, only sizeType via typeToFontSize)
- Add explicit color to crown icons (yellowDark for owner, black_35
  for admin) at all call sites that relied on old Icon defaultColor
- Add explicit color={black_20} to iconfont-close Icon2 usages
When Icon2's color resolves to a CSS variable (e.g. var(--color-black_50)),
use a CSS class (color_black_50) instead of an inline style. Inline styles
have higher specificity than CSS classes, which broke cases like the sidebar
tab icons where external CSS overrides the default color.
Box2 adds alignSelf:'center' by default which shifted the checkbox
box position. The old Icon used a plain <div> for boxStyle, so match
that behavior.
- visual-diff-take.js: captures all 8 app tabs via CDP
- visual-diff-compare.sh: ImageMagick pixel diff with classification
- Updated PERF-TESTING.md with workflow and diff reading guide
Delete the old Icon component (icon.desktop.tsx, icon.native.tsx, icon.d.ts)
and rename Icon2 to Icon across the entire codebase (~180 consumer files).

- Rename types: Icon2Props → IconProps, SizeType2 → SizeType
- Strip icon.shared.tsx of unused functions (defaultColor, defaultHoverColor,
  fontSize, typeToFontSize, paddingStyles)
- Move iconTypeToImgSet into the new icon.tsx with platform branching
- Remove IconStyle type, urlsToImgSet export (no consumers)
- Update barrel exports (index.d.ts, index-impl.js)
Extract iconTypeToImgSet and getMultsMap from icon.tsx/icon.shared.tsx into
a dedicated helper at common-adapters/avatar/icon-to-img-set.tsx. This keeps
the icon module focused on the Icon component itself.
@chrisnojima chrisnojima changed the title WIP: icon2 cleanup icon2 cleanup Mar 7, 2026
@chrisnojima chrisnojima merged commit c9cf2f7 into nojima/HOTPOT-next-670-clean Mar 7, 2026
1 check was pending
@chrisnojima chrisnojima deleted the nojima/HOTPOT-icon2-cleanup branch March 7, 2026 23:36
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