Skip to content

fix: kanban-board examples#1829

Merged
shinokada merged 3 commits intothemesberg:mainfrom
shinokada:kanban-doc-update
Nov 9, 2025
Merged

fix: kanban-board examples#1829
shinokada merged 3 commits intothemesberg:mainfrom
shinokada:kanban-doc-update

Conversation

@shinokada
Copy link
Copy Markdown
Collaborator

@shinokada shinokada commented Nov 9, 2025

🔗 Related issue (optional)

Closes #


📑 Description


🔍 PR Type

  • Bug fix
  • Feature
  • Documentation
  • Refactor / Code cleanup
  • Build / Tooling
  • Other (please describe)

🚦 PR Status

  • Draft (work in progress, not ready for review)
  • Ready for review ✅

✅ Checklist

  • My code follows the existing code style
  • I have run pnpm check && pnpm test:e2e and all tests pass
  • CoderabbitAI review has been completed and actionable suggestions were reviewed
  • I have updated documentation if my changes require it
  • I have updated the api-check directory if a component API changed
  • My PR is based on the latest main branch (not the published npm version)
  • I have checked accessibility where applicable (ARIA, keyboard nav, etc.)
  • I have reviewed the rendered component in the browser

🧪 Screenshots / Demos (optional)


⚠️ Breaking Changes (optional)


ℹ️ Additional Information

Summary by CodeRabbit

  • New Features

    • Board-level cardProps to customize per-card appearance/behavior.
    • New modal-based "Add Card" example with validation and error display.
  • Style

    • Improved dark-mode text and enhanced card shadowing across Kanban components.
  • Documentation

    • Updated examples and docs to include the modal example, revised demos, and usage guidance (removed one older example).
  • Chores

    • Added/updated package scripts for checks and simplified issue template.

@vercel
Copy link
Copy Markdown

vercel bot commented Nov 9, 2025

@shinokada is attempting to deploy a commit to the Themesberg Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 9, 2025

Walkthrough

Adds an optional cardProps prop to KanbanBoard and spreads it onto each KanbanCard; extends dark-mode theme classes and card shadow tokens; updates/adds Kanban examples (including a modal-driven add-card example), removes an obsolete example, tweaks docs, and adjusts package check scripts.

Changes

Cohort / File(s) Summary
Core component + types
src/lib/kanban/KanbanBoard.svelte, src/lib/types.ts
Adds exported optional `cardProps?: Partial<Omit<KanbanCardProps, 'card'
Theme updates
src/lib/kanban/theme.ts
Dark-mode and shadow tweaks: columnTitle gains dark:text-white; addButton gains dark:text-primary-500; card adds shadow-black/20 dark:shadow-white/10; card title/description/tags/tag gain dark:text-white.
Examples — added / updated
src/routes/docs-examples/extend/kanban-board/UsingModal.svelte, src/routes/docs-examples/extend/kanban-board/ApiIntegration.svelte, src/routes/docs-examples/extend/kanban-board/Default.svelte, src/routes/docs-examples/extend/kanban-board/LocalStorage.svelte
Adds UsingModal.svelte (modal add-card flow with validation and UUID); ApiIntegration, Default, and LocalStorage updated to remove manual reactive cloning in move handlers, add/import UI components (Heading, P, Button), add dark-mode/container classes, error display in API example, and classes usage in LocalStorage.
Examples — removed
src/routes/docs-examples/extend/kanban-board/CustomStyling.svelte
Deleted obsolete CustomStyling.svelte example and its handlers.
Docs
src/routes/docs/extend/kanban-board.md
Replaced CustomStyling snippet with UsingModal.svelte, added dirName = 'kanban', and appended Component data / GitHub / LLM link sections.
Package scripts
package.json
Augments check script to ignore src/routes/testdir/*; adds check:ignore script running sv with ignores for src/routes/testdir, dist, build, and --no-tsconfig.
Repo template
.github/ISSUE_TEMPLATE/bug_report.yml
Simplified bug report template by removing several top-level form sections and retaining the main description and checklist.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant User
  participant UsingModal as UsingModal (example)
  participant KanbanBoard as KanbanBoard
  participant KanbanCard as KanbanCard

  Note over UsingModal,KanbanBoard: Modal-driven add-card flow (new example)
  User->>UsingModal: click "Add Card" for column
  UsingModal->>UsingModal: open modal (formModal = true)
  User->>UsingModal: submit form (title, desc, tags)
  UsingModal->>UsingModal: validate input, create card (crypto.randomUUID)
  UsingModal->>KanbanBoard: call onAddCard(newCard, targetColumnId)
  KanbanBoard->>KanbanCard: render card with required props + ...cardProps
  KanbanCard-->>User: new card appears in column
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Areas to inspect:
    • cardProps type correctness (Omit + Partial) in src/lib/types.ts
    • Spread order of ...cardProps in src/lib/kanban/KanbanBoard.svelte to ensure required handlers aren't overridden
    • Theme class changes in src/lib/kanban/theme.ts for consistency
    • Validation, UUID generation, and state updates in UsingModal.svelte
    • Example edits that removed manual reactive reassignments to ensure behavior remains correct

Possibly related PRs

Poem

🐰 I tuck a prop into each little card,

shadows deepen, dark mode guards,
a modal hums and IDs are spun,
examples updated, old one done,
I hop away — new features marred by none.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description follows the template structure with PR Type checkboxes marked and a comprehensive checklist, but lacks substantive content in the Description section which is left as a template comment without actual explanation of the changes. Add a detailed description of the changes made, explaining what was fixed, why the changes were necessary, and how they improve the kanban-board examples.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: kanban-board examples' is concise and clearly relates to the main changes, which span bug fixes and documentation updates to the Kanban board examples across multiple files including components, theme, types, and docs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 77b8ade and 573d820.

📒 Files selected for processing (1)
  • .github/ISSUE_TEMPLATE/bug_report.yml (0 hunks)
💤 Files with no reviewable changes (1)
  • .github/ISSUE_TEMPLATE/bug_report.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Playwright and Lint

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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/routes/docs-examples/extend/kanban-board/ApiIntegration.svelte (1)

68-80: Consider adding dark mode styling to the wrapper.

The wrapper div uses bg-white but lacks a dark mode alternative. Since other files in this PR add dark mode support, consider adding dark:bg-gray-800 for consistency.

Apply this diff:

-<div class="p-4 bg-white">
+<div class="p-4 bg-white dark:bg-gray-800">
src/routes/docs-examples/extend/kanban-board/UsingModal.svelte (1)

93-93: Redundant dark mode class on cardTags.

Line 93 sets cardTags: "text-gray-900 dark:text-gray-900", which applies the same color in both light and dark modes. This is redundant unless intentional for consistency.

Consider simplifying to:

-    cardTags: "text-gray-900 dark:text-gray-900"
+    cardTags: "text-gray-900"

Or if you want different dark mode styling:

-    cardTags: "text-gray-900 dark:text-gray-900"
+    cardTags: "text-gray-900 dark:text-gray-100"
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 662b4dc and 11abcbe.

📒 Files selected for processing (9)
  • src/lib/kanban/KanbanBoard.svelte (3 hunks)
  • src/lib/kanban/theme.ts (2 hunks)
  • src/lib/types.ts (1 hunks)
  • src/routes/docs-examples/extend/kanban-board/ApiIntegration.svelte (2 hunks)
  • src/routes/docs-examples/extend/kanban-board/CustomStyling.svelte (0 hunks)
  • src/routes/docs-examples/extend/kanban-board/Default.svelte (2 hunks)
  • src/routes/docs-examples/extend/kanban-board/LocalStorage.svelte (2 hunks)
  • src/routes/docs-examples/extend/kanban-board/UsingModal.svelte (1 hunks)
  • src/routes/docs/extend/kanban-board.md (3 hunks)
💤 Files with no reviewable changes (1)
  • src/routes/docs-examples/extend/kanban-board/CustomStyling.svelte
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Playwright and Lint
🔇 Additional comments (8)
src/lib/kanban/theme.ts (1)

11-11: LGTM! Dark mode support properly added.

The dark mode text color additions for columnTitle, addButton, and cardTags ensure proper visibility in dark mode. The Tailwind v4 syntax is correct.

Also applies to: 19-19, 40-40

src/routes/docs-examples/extend/kanban-board/LocalStorage.svelte (1)

2-2: LGTM! Clean refactoring with improved styling customization.

The changes improve the component by:

  • Using the Button component for consistent styling
  • Adding dark mode support to the title
  • Leveraging the new classes prop for granular style control
  • Simplifying handleMove to rely on internal state management

Also applies to: 30-32, 64-75

src/lib/types.ts (1)

2117-2117: LGTM! Well-designed type definition for card customization.

The cardProps type correctly uses Partial<Omit<...>> to allow optional per-card customization while protecting required internal props (card, isDragging, and drag handlers). This provides a clean API for board-level card styling.

src/routes/docs/extend/kanban-board.md (1)

15-15: LGTM! Documentation properly updated.

The documentation improvements include:

  • Adding dirName constant for component attribute viewer
  • Replacing the example with UsingModal.svelte to showcase modal-based card addition
  • Adding component data, GitHub links, and LLM link sections for better discoverability

Also applies to: 37-37, 59-72

src/lib/kanban/KanbanBoard.svelte (1)

12-12: LGTM! Proper implementation of cardProps propagation.

The cardProps prop is correctly:

  • Destructured from props (line 12)
  • Spread onto each KanbanCard instance (line 96)
  • Positioned to allow overriding classes while protecting drag handlers

This enables flexible per-card customization from the board level.

Also applies to: 93-100

src/routes/docs-examples/extend/kanban-board/UsingModal.svelte (2)

29-31: Verify that shallow clone triggers reactivity.

The handleMove function performs a shallow clone columns = [...columns] to trigger reactivity. Since KanbanBoard already mutates the columns internally during drag-and-drop, this should work. However, ensure this pattern is consistently tested across different scenarios.


67-67: Verify browser support for crypto.randomUUID().

The code uses crypto.randomUUID() for ID generation, which requires:

  • Secure context (HTTPS or localhost)
  • Modern browser support (Chrome 92+, Firefox 95+, Safari 15.4+)

If broader browser support is needed, consider a fallback or polyfill.

src/routes/docs-examples/extend/kanban-board/Default.svelte (1)

2-2: LGTM! Excellent demonstration of the new cardProps API.

The changes showcase best practices:

  • Using Heading and P components for consistent typography
  • Adding dark mode support with dark:bg-gray-800
  • Demonstrating the new cardProps API with nested classes for granular card styling
  • Clean separation of concerns between board-level and card-level customization

Also applies to: 95-113

@shinokada shinokada merged commit 5a472c1 into themesberg:main Nov 9, 2025
1 of 2 checks passed
@shinokada shinokada deleted the kanban-doc-update branch November 9, 2025 18:27
This was referenced Dec 29, 2025
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.

1 participant