icon2 cleanup#28998
Merged
chrisnojima merged 20 commits intonojima/HOTPOT-next-670-cleanfrom Mar 7, 2026
Merged
Conversation
- 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
…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.
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.
No description provided.