Skip to content

Add badge-based tag input for deck categories#108

Merged
Fx64b merged 2 commits intomainfrom
claude/add-deck-badges-BKyS9
Jan 26, 2026
Merged

Add badge-based tag input for deck categories#108
Fx64b merged 2 commits intomainfrom
claude/add-deck-badges-BKyS9

Conversation

@Fx64b
Copy link
Owner

@Fx64b Fx64b commented Jan 24, 2026

Implement a tag input component that creates badges when users press Enter, Space, or Comma keys. This replaces the single category text field with a multi-tag system that:

  • Creates badges on Enter, Space, or Comma keypress
  • Allows removing tags by clicking the X button
  • Stores tags as JSON array in the category field for backward compatibility
  • Displays tags as badges on deck cards
  • Supports legacy single-category decks by parsing them as single-tag arrays

Changes:

  • Add new TagInput component using shadcn badges
  • Update deck creation form to use TagInput
  • Update deck edit form to use TagInput with tag parsing
  • Update deck card to display category tags as badges

Implement a tag input component that creates badges when users press Enter, Space, or Comma keys. This replaces the single category text field with a multi-tag system that:

- Creates badges on Enter, Space, or Comma keypress
- Allows removing tags by clicking the X button
- Stores tags as JSON array in the category field for backward compatibility
- Displays tags as badges on deck cards
- Supports legacy single-category decks by parsing them as single-tag arrays

Changes:
- Add new TagInput component using shadcn badges
- Update deck creation form to use TagInput
- Update deck edit form to use TagInput with tag parsing
- Update deck card to display category tags as badges
@vercel
Copy link

vercel bot commented Jan 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
learn Ready Ready Preview, Comment Jan 24, 2026 9:02am

@claude
Copy link

claude bot commented Jan 24, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

Create a utility function to parse category fields that handles multiple legacy formats:
- JSON arrays (new format): ["Math", "Science"]
- Comma-separated (legacy): "Math, Science, History"
- Space-separated (legacy): "Math Science History"
- Single value (legacy): "Mathematics"

The parser prioritizes comma separation over space separation to preserve
multi-word tags like "Computer Science" when comma-separated.

Changes:
- Add parseCategoryToTags utility function in lib/category-parser.ts
- Update deck-card component to use centralized parser
- Update deck edit form to use centralized parser
- Add comprehensive tests covering all legacy formats and edge cases
@claude
Copy link

claude bot commented Jan 24, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@Fx64b Fx64b merged commit f5832e9 into main Jan 26, 2026
6 of 7 checks passed
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.

2 participants