Add badge-based tag input for deck categories#108
Merged
Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
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 encountered an error —— View job I'll analyze this and get back to you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Changes: