Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 14, 2025

Proposed changes

Adds interactive code examples to the icon overview page. Each icon card now displays a popover with 6 implementation snippets (before/after × basic/weight/variant combinations) when hovering over a code button. Uses existing DBPopover and CopyClipboardButton components.

Implementation:

  • IconCodeSnippet component: Generates contextual HTML snippets based on selected weight/family, renders in popover
  • Icon overview integration: Adds code button to top-right of each card, passes current filter state
  • Styling: Positions button, styles popover with scrollable content (max-height 400px)

Example snippet generated:

// For icon "home" with weight=24, family="filled"
<span data-icon="home" data-icon-weight="24" data-icon-variant="filled">Text</span>

Icon Overview Enhancement

resolves #3961

Types of changes

  • Bugfix (non-breaking change that fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improvements to existing components or architectural decisions)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Further comments

Snippet generation logic is pure function of icon name and current filter selections—no state management complexity. Copy functionality delegates to existing CopyClipboardButton with tooltip feedback.

Original prompt

This section details on the original issue you should resolve

<issue_title>Provide further functionality on icon overview</issue_title>
<issue_description>Es wäre hilfreich, wenn unter /icons/overview für ein ausgewähltes Icon ein Beispiel pro Icon und Voreinstellung (Icon weight & variant) angezeigt wird wie dies zu implementieren ist. Dies kann z. B. in einem popover statt finden.

@mfranzke Ja so in etwa hätte ich mir das vorgestellt. Direkt auch mit Button der einem das Snippet in die Zwischenablage kopiert.

Originally posted by @nfellinger in #3961</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

🔭🐙🐈 Test this branch here: https://design-system.deutschebahn.com/core-web/review/copilot/add-icon-sample-display

@changeset-bot
Copy link

changeset-bot bot commented Nov 14, 2025

⚠️ No Changeset found

Latest commit: 5209282

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com>
Copilot AI changed the title [WIP] Add example display for icon overview functionality feat: add code snippet popover to icon overview with copy-to-clipboard Nov 14, 2025
Copilot AI requested a review from mfranzke November 14, 2025 20:22
Copilot finished work on behalf of mfranzke November 14, 2025 20:22
@github-actions github-actions bot added the 📺showcases Changes to 1-n showcases label Nov 14, 2025
@mfranzke mfranzke marked this pull request as ready for review November 14, 2025 22:40
@mfranzke mfranzke marked this pull request as draft November 14, 2025 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📺showcases Changes to 1-n showcases

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

Provide further functionality on icon overview Fehlende Angaben zur Icon Verwendung

2 participants