📦 refactor(kbd): add keyboard group demo and button variant showcase#587
📦 refactor(kbd): add keyboard group demo and button variant showcase#587mikij wants to merge 1 commit intorefactor/tooltipfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@libs/zard/src/lib/shared/components/kbd/demo/button.ts`:
- Around line 9-10: The selector "z-demo-kbd-default" in the `@Component`
decorator of button.ts conflicts with the same selector in default.ts; update
the selector in the component defined in button.ts (the `@Component` decorator
inside libs/zard/src/lib/shared/components/kbd/demo/button.ts) to a unique name
(e.g., "z-demo-kbd-button") and update any template usages or tests that
reference the old selector so only one component matches that selector at
runtime.
- Around line 16-19: Remove the redundant wrapper div around the icon in the
ZardKbdComponent demo template: inside the <z-kbd> in
libs/zard/src/lib/shared/components/kbd/demo/button.ts remove the <div
class="flex justify-center"> and its closing </div> so that the <ng-icon
name="lucideCornerDownLeft" strokeWidth="3" /> is a direct child of the <z-kbd>;
the kbd element already applies inline-flex items-center justify-center, so no
additional wrapper is needed.
In `@libs/zard/src/lib/shared/components/kbd/demo/default.ts`:
- Around line 10-21: Add or update a kbd E2E test (e.g., kbd.spec.ts) that
navigates to the component/demo page and verifies the updated centered demo
markup by using stable component selectors: assert presence of <z-kbd-group>
elements, that the first <z-kbd-group> contains four <z-kbd> nodes with text
"⌘", "⇧", "⌥", "⌃", and the second group contains <z-kbd> "Ctrl", a "+"
separator, and <z-kbd> "B"; use queries by tag name (z-kbd, z-kbd-group) and
text assertions rather than fragile class/position selectors so the test will
remain stable.
In `@libs/zard/src/lib/shared/components/kbd/demo/group.ts`:
- Around line 10-14: The demo text in the Zard keyboard group reads as a single
combined sequence because the two alternatives are adjacent; update the content
inside z-kbd-group so alternative shortcuts are separated (e.g., insert an
explicit separator like the word "or" or a comma between the two z-kbd elements)
so the sentence reads "Use <z-kbd>Ctrl + B</z-kbd> or <z-kbd>Ctrl + K</z-kbd> to
open command palette"; modify the markup around the z-kbd-group / z-kbd elements
accordingly.
In `@libs/zard/src/lib/shared/components/kbd/kbd.component.ts`:
- Line 12: The inner native <kbd> element in kbd.component.ts currently keeps
Tailwind's monospace font and won't inherit host font classes; update the
template line that contains <kbd data-slot="kbd"><ng-content /></kbd> to add
class="font-[inherit]" so the <kbd> inherits the host computed font classes
(e.g., when font-sans is applied) and projected content uses the intended
typography.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 42187554-10ab-4944-9343-f1aae121bfb2
⛔ Files ignored due to path filters (6)
apps/web/public/r/kbd.jsonis excluded by!apps/web/public/**and included byapps/**apps/web/src/generated/components/kbd/demo/button.tsis excluded by!**/generated/**and included byapps/**apps/web/src/generated/components/kbd/demo/default.tsis excluded by!**/generated/**and included byapps/**apps/web/src/generated/components/kbd/demo/group.tsis excluded by!**/generated/**and included byapps/**apps/web/src/generated/components/kbd/demo/tooltip.tsis excluded by!**/generated/**and included byapps/**apps/web/src/generated/installation/manual/kbd.tsis excluded by!**/generated/**and included byapps/**
📒 Files selected for processing (8)
libs/zard/src/lib/shared/components/kbd/demo/button.tslibs/zard/src/lib/shared/components/kbd/demo/default.tslibs/zard/src/lib/shared/components/kbd/demo/group.tslibs/zard/src/lib/shared/components/kbd/demo/kbd.tslibs/zard/src/lib/shared/components/kbd/demo/tooltip.tslibs/zard/src/lib/shared/components/kbd/kbd-group.component.tslibs/zard/src/lib/shared/components/kbd/kbd.component.tslibs/zard/src/lib/shared/components/kbd/kbd.variants.ts
66e4f1f to
926a5f7
Compare
What was done? 📝
Screenshots or GIFs 📸
|-----Figma-----|
|-----Implementation-----|
Link to Issue 🔗
Closes #534
Type of change 🏗
Breaking change 🚨
Checklist 🧐
Summary by CodeRabbit
New Features
Documentation
Style