Skip to content

Improve Iconography page (#12576)#12577

Open
mhrastegari wants to merge 6 commits into
bitfoundation:developfrom
mhrastegari:12576-improve-iconography-page
Open

Improve Iconography page (#12576)#12577
mhrastegari wants to merge 6 commits into
bitfoundation:developfrom
mhrastegari:12576-improve-iconography-page

Conversation

@mhrastegari

@mhrastegari mhrastegari commented Jul 4, 2026

Copy link
Copy Markdown
Member

Close #12576

Summary by CodeRabbit

  • New Features
    • Added an icon details panel workflow on the Iconography page, including a hero for the selected icon, dismiss support, multi-size/color previews, and XML usage snippets.
    • Introduced reusable “detail rows” (label + code-styled value) with copy-to-clipboard behavior and visual feedback, including optional glyph display when available.
  • Bug Fixes
    • Improved clipboard copy feedback behavior so actions confirm and then automatically reset.
    • Enhanced icon search/filtering to match both icon values and their display field.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Adds a reusable IconDetailRow component and updates IconographyPage to use IconInfo records, open an icon details panel, load glyph data lazily, and provide keyed copy feedback for icon details and snippets.

Changes

Icon details panel feature

Layer / File(s) Summary
IconDetailRow component
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/IconDetailRow.razor, src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/IconDetailRow.razor.cs, src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/IconDetailRow.razor.scss
Adds a reusable detail row with label, code-styled value, copy button state, OnCopy callback, and row styling.
IconographyPage state model and glyph loading
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor.cs
Replaces string icon state with IconInfo, updates filtering and selection, loads glyph mappings from CSS on demand, and routes clipboard actions through keyed feedback state.
Icon tile selection and details panel UI
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor
Changes icon tiles to open the details panel, renders selected-icon previews, property rows, glyph data, usage samples, and copy actions, and updates the page notes.
Icon box and panel styling
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor.scss
Updates icon tile hover and selected styling and adds layout, spacing, grid, and typography rules for the details panel.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant IconographyPage
  participant HttpClient
  participant IconDetailRow

  User->>IconographyPage: click icon tile
  IconographyPage->>IconographyPage: OpenIconPanel(IconInfo)
  IconographyPage->>HttpClient: fetch icons CSS when needed
  HttpClient-->>IconographyPage: return parsed glyph mappings
  IconographyPage-->>IconDetailRow: render detail rows
  User->>IconDetailRow: click copy button
  IconDetailRow->>IconographyPage: OnCopy(Value, CopyKey)
  IconographyPage->>IconographyPage: CopyToClipboard(text, feedbackKey)
  IconographyPage-->>IconDetailRow: update CopyFeedbackKey
  IconDetailRow-->>User: show copied state
Loading

Poem

A rabbit tapped an icon bright,
And out popped details, neat and light.
Sizes, glyphs, and snippets too,
Copy clicks now sparkle through.
🐇✨ Hop, panel, hop — all brand new!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes add an icon details panel and copyable icon details, matching issue #12576.
Out of Scope Changes check ✅ Passed The modifications stay focused on the Iconography page and its supporting component/styles.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the main change: improvements to the Iconography page.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/IconDetailRow.razor.scss`:
- Around line 17-26: The IconDetailRow.razor.scss rule for
.icon-detail-row-value uses multi-word font-family names without quotes, which
Stylelint flags. Update the font-family declaration in the
.icon-detail-row-value block so any family names containing spaces are quoted,
while keeping the same fallback stack and monospace intent intact.

In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor.cs`:
- Around line 9-18: The RazorIconInfo property in IconInfo is producing
copy-paste snippets with invalid Razor attribute quoting because the nested
quotes around BitIconInfo.Bit(Value) are not escaped for the outer double-quoted
attribute. Update RazorIconInfo so the generated string is valid Razor syntax
when pasted into a .razor file, and verify the resulting snippet still matches
the style used by ConstantReference, CssClass, and RazorIconName.
- Around line 92-102: The icon panel is clearing selectedIcon too early, which
can blank the panel body before BitPanel finishes its close animation. Update
CloseIconPanel and its call path from HandleIconPanelDismissed so selectedIcon
is only cleared after the panel has fully dismissed, while still setting
isIconPanelOpen to false immediately. Use the existing IconographyPage component
state flow to defer the content reset until after the close transition
completes.

In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor.scss`:
- Around line 14-18: The .icon-name rule uses the deprecated word-break:
break-word value, so update the IconographyPage.razor.scss styles to use a
current text-wrapping approach instead. Locate the .icon-name selector and
replace the deprecated declaration with the appropriate modern CSS
property/value combination that preserves label wrapping behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 21b8f43a-f81e-497b-8090-1a455232d70b

📥 Commits

Reviewing files that changed from the base of the PR and between fdc46a8 and 8727649.

📒 Files selected for processing (6)
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/IconDetailRow.razor
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/IconDetailRow.razor.cs
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/IconDetailRow.razor.scss
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor.cs
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor.scss

@mhrastegari

Copy link
Copy Markdown
Member Author

@coderabbitai re-review

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

@mhrastegari, sure, I'll take another look at the changes.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@msynk

msynk commented Jul 11, 2026

Copy link
Copy Markdown
Member

@coderabbitai full-review

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

@msynk, sure, I'll perform a full review of all the changes in this PR.

✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

@msynk, sure, I'll perform a full review of all the changes in this PR.

✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor (1)

12-14: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Update stale PageOutlet description to reflect the new details panel behavior.

The description still says "copy any icon name with a click," but the click now opens an icon details panel. The in-page note (lines 44–45) was updated; this should be too.

✏️ Proposed fix
-            Description="Browse and search the full set of Fabric (MDL2) icons available in bit BlazorUI, and copy any icon name with a click." />
+            Description="Browse and search the full set of Fabric (MDL2) icons available in bit BlazorUI. Click any icon to view its details and copy usage snippets." />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor`
around lines 12 - 14, Update the Description attribute of the IconographyPage
PageOutlet to describe that clicking an icon opens its details panel, replacing
the stale claim that users can copy the icon name with a click.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor.cs`:
- Around line 42-47: Remove the unused cascadingParams field from the
IconographyPage code-behind; the Razor markup already references
_cascadingParams defined in its `@code` block, so do not alter the existing markup
or that field.
- Around line 111-118: The GetGlyphCode method currently formats the literal
backslash from CSS-escaped glyph values instead of the actual codepoint. Decode
or remove the leading backslash from the glyph string before calling
char.ConvertToUtf32, then format the resulting codepoint with the existing
escape prefix and hexadecimal formatting.

---

Outside diff comments:
In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor`:
- Around line 12-14: Update the Description attribute of the IconographyPage
PageOutlet to describe that clicking an icon opens its details panel, replacing
the stale claim that users can copy the icon name with a click.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a12bad27-7c83-4281-8a74-ea0d515995de

📥 Commits

Reviewing files that changed from the base of the PR and between fdc46a8 and 79c754e.

📒 Files selected for processing (6)
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/IconDetailRow.razor
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/IconDetailRow.razor.cs
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/IconDetailRow.razor.scss
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor.cs
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor.scss

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor.cs (1)

111-118: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

GetGlyphCode produces incorrect glyph codes — it formats the CSS backslash, not the codepoint.

CSS escape values captured by the regex (e.g., \E498) start with a literal backslash. char.ConvertToUtf32(glyph, 0) reads that backslash character (U+005C = 92), so the output becomes \005C instead of \E498. This was flagged in a prior review and remains unaddressed.

🐛 Proposed fix
 private string? GetGlyphCode(IconInfo icon)
 {
     if (iconGlyphs is null) return null;

     if (iconGlyphs.TryGetValue(icon.Value, out var glyph) is false || string.IsNullOrEmpty(glyph)) return null;

-    return $"\\{char.ConvertToUtf32(glyph, 0):X4}";
+    var hex = glyph.TrimStart('\\');
+    return int.TryParse(hex, System.Globalization.NumberStyles.HexNumber, null, out var code)
+        ? $"\\{code:X4}"
+        : glyph;
 }
#!/bin/bash
# Verify the CSS glyph format to confirm the backslash issue.
scss=$(fd -t f "bit.blazorui.icons.scss" src/ 2>/dev/null | head -1)
if [ -n "$scss" ]; then
  echo "== Sample content declarations from SCSS source =="
  rg -n 'content:' "$scss" | head -10
  echo ""
  echo "== Checking for backslash-escape sequences =="
  rg -qP 'content:\s*"\\' "$scss" && echo "CSS uses \\HEX escape sequences (confirms bug)" || echo "No backslash escapes found"
else
  echo "SCSS source not found; searching for compiled CSS..."
  fd -t f "bit.blazorui.icons.css" 2>/dev/null | head -5
fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor.cs`
around lines 111 - 118, The GetGlyphCode method incorrectly converts the leading
CSS backslash instead of the glyph codepoint. Update GetGlyphCode to strip the
leading backslash from glyph before parsing or returning the escape, then
preserve the actual hexadecimal codepoint (such as E498) with a single CSS
backslash prefix; retain the existing null and empty-value handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor.cs`:
- Around line 111-118: The GetGlyphCode method incorrectly converts the leading
CSS backslash instead of the glyph codepoint. Update GetGlyphCode to strip the
leading backslash from glyph before parsing or returning the escape, then
preserve the actual hexadecimal codepoint (such as E498) with a single CSS
backslash prefix; retain the existing null and empty-value handling.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a12bad27-7c83-4281-8a74-ea0d515995de

📥 Commits

Reviewing files that changed from the base of the PR and between fdc46a8 and 79c754e.

📒 Files selected for processing (6)
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/IconDetailRow.razor
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/IconDetailRow.razor.cs
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/IconDetailRow.razor.scss
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor.cs
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor.scss

@mhrastegari

Copy link
Copy Markdown
Member Author

@coderabbitai re-review

@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

@mhrastegari, sure, I'll take another look at the changes.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@msynk

msynk commented Jul 12, 2026

Copy link
Copy Markdown
Member

@coderabbitai full-review

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

@msynk, sure, I'll perform a full review of all the changes in this PR.

✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor (1)

14-14: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Update the stale PageOutlet description.

The description still says "copy any icon name with a click," but clicking an icon now opens a details panel. Update to reflect the new behavior.

✏️ Proposed fix
-            Description="Browse and search the full set of Fabric (MDL2) icons available in bit BlazorUI, and copy any icon name with a click." />
+            Description="Browse and search the full set of Fabric (MDL2) icons available in bit BlazorUI. Click an icon to preview sizes, colors, and copy usage snippets." />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor`
at line 14, Update the PageOutlet Description in IconographyPage to state that
clicking an icon opens its details panel instead of claiming that it copies the
icon name.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In
`@src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor`:
- Line 14: Update the PageOutlet Description in IconographyPage to state that
clicking an icon opens its details panel instead of claiming that it copies the
icon name.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0d8f6049-59e0-4e9b-91d5-245e1925b2dc

📥 Commits

Reviewing files that changed from the base of the PR and between fdc46a8 and 3ff10cf.

📒 Files selected for processing (6)
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/IconDetailRow.razor
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/IconDetailRow.razor.cs
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/IconDetailRow.razor.scss
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor.cs
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Pages/IconographyPage.razor.scss

@msynk msynk changed the title Improve the Iconography page (#12576) Improve Iconography page (#12576) Jul 12, 2026
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.

The Iconography page needs some improvements

2 participants