-
Notifications
You must be signed in to change notification settings - Fork 51.1k
docs: Add component specification and usage examples for N8nBadge #22049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
BundleMonUnchanged files (2)
No change in files bundle size Groups updated (2)
Final result: ✅ View report in BundleMon website ➡️ |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 issues found across 1 file
Prompt for AI agents (all 3 issues)
Understand the root cause of the following 3 issues and fix them.
<file name="packages/frontend/@n8n/design-system/src/v2/components/Badge/component-badge.md">
<violation number="1" location="packages/frontend/@n8n/design-system/src/v2/components/Badge/component-badge.md:50">
The status-indicator example calls `ref()` but never imports it from Vue, so the provided code snippet will throw `ref is not defined` when used. Please import `ref` alongside `computed` so the example compiles.</violation>
<violation number="2" location="packages/frontend/@n8n/design-system/src/v2/components/Badge/component-badge.md:76">
The count-badge example uses `ref()` for `filterCount` but never imports it from Vue, which makes the snippet uncompilable as written. Add the missing `ref` import so readers can paste the example without errors.</violation>
<violation number="3" location="packages/frontend/@n8n/design-system/src/v2/components/Badge/component-badge.md:153">
The conditional-rendering example references Vue’s `ref()` twice but never imports it, so copying the snippet results in a runtime ReferenceError. Import `ref` from 'vue' in this script block.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| <script setup lang="ts"> | ||
| import { N8nBadge } from '@n8n/design-system' | ||
|
|
||
| const isReadOnly = ref(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conditional-rendering example references Vue’s ref() twice but never imports it, so copying the snippet results in a runtime ReferenceError. Import ref from 'vue' in this script block.
Prompt for AI agents
Address the following comment on packages/frontend/@n8n/design-system/src/v2/components/Badge/component-badge.md at line 153:
<comment>The conditional-rendering example references Vue’s `ref()` twice but never imports it, so copying the snippet results in a runtime ReferenceError. Import `ref` from 'vue' in this script block.</comment>
<file context>
@@ -0,0 +1,220 @@
+<script setup lang="ts">
+import { N8nBadge } from '@n8n/design-system'
+
+const isReadOnly = ref(true)
+const needsSetup = ref(false)
+</script>
</file context>
| <script setup lang="ts"> | ||
| import { N8nBadge } from '@n8n/design-system' | ||
|
|
||
| const filterCount = ref(5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The count-badge example uses ref() for filterCount but never imports it from Vue, which makes the snippet uncompilable as written. Add the missing ref import so readers can paste the example without errors.
Prompt for AI agents
Address the following comment on packages/frontend/@n8n/design-system/src/v2/components/Badge/component-badge.md at line 76:
<comment>The count-badge example uses `ref()` for `filterCount` but never imports it from Vue, which makes the snippet uncompilable as written. Add the missing `ref` import so readers can paste the example without errors.</comment>
<file context>
@@ -0,0 +1,220 @@
+<script setup lang="ts">
+import { N8nBadge } from '@n8n/design-system'
+
+const filterCount = ref(5)
+</script>
+
</file context>
| ```typescript | ||
| <script setup lang="ts"> | ||
| import { N8nBadge } from '@n8n/design-system' | ||
| import { computed } from 'vue' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The status-indicator example calls ref() but never imports it from Vue, so the provided code snippet will throw ref is not defined when used. Please import ref alongside computed so the example compiles.
Prompt for AI agents
Address the following comment on packages/frontend/@n8n/design-system/src/v2/components/Badge/component-badge.md at line 50:
<comment>The status-indicator example calls `ref()` but never imports it from Vue, so the provided code snippet will throw `ref is not defined` when used. Please import `ref` alongside `computed` so the example compiles.</comment>
<file context>
@@ -0,0 +1,220 @@
+```typescript
+<script setup lang="ts">
+import { N8nBadge } from '@n8n/design-system'
+import { computed } from 'vue'
+
+const status = ref<'success' | 'warning' | 'danger'>('success')
</file context>
| import { computed } from 'vue' | |
| import { computed, ref } from 'vue' |
|
✅ No visual regressions found. |
|
Got released with |
Summary
Add API specification for N8nBadge migration to Reka UI design system, documenting all 4 props and 7 theme variants currently used in the codebase (including theme, size, bold, showBorder) with usage examples and implementation notes for backward compatibility.
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/DS-340/write-badge-api-specs
Review / Merge checklist
release/backport(if the PR is an urgent fix that needs to be backported)Note
Add N8nBadge docs with API (props/slot) and practical Vue usage examples.
packages/frontend/@n8n/design-system/src/v2/components/Badge/component-badge.mddocumentingN8nBadge.theme(7 variants),size,bold,showBorder;defaultslot.Written by Cursor Bugbot for commit 859aea6. This will update automatically on new commits. Configure here.