Skip to content

Add tag types, validation & TagMultiSelect#191

Merged
zakkiyyat merged 2 commits into
MixMatch-Inc:mainfrom
nottherealalanturing:ft/create
Jun 22, 2026
Merged

Add tag types, validation & TagMultiSelect#191
zakkiyyat merged 2 commits into
MixMatch-Inc:mainfrom
nottherealalanturing:ft/create

Conversation

@nottherealalanturing

Copy link
Copy Markdown
Contributor

Introduce tag support and a UI picker.

  • Add a client-side TagMultiSelect React component (options, selected, onChange, max, label) with toggle behavior and disabled state when max is reached.
  • Add CUISINE_TAGS and DIETARY_TAGS constants and simple tag types in packages/shared.
  • Add Zod validation schemas (cuisineTagSchema, dietaryTagSchema) that enforce allowed tags.
  • Export the new types and validation from packages/shared/src/index.ts.
  • Update .gitignore

closes #187

Introduce tag support and a UI picker.

- Add a client-side TagMultiSelect React component (options, selected, onChange, max, label) with toggle behavior and disabled state when max is reached.
- Add CUISINE_TAGS and DIETARY_TAGS constants and simple tag types in packages/shared.
- Add Zod validation schemas (cuisineTagSchema, dietaryTagSchema) that enforce allowed tags.
- Export the new types and validation from packages/shared/src/index.ts.
- Update .gitignore

@zakkiyyat zakkiyyat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please fix this so I can merge

Comment thread packages/shared/src/types/tags.ts Outdated
Comment on lines +28 to +29
export type CuisineTag = string;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CUISINE_TAGS and DIETARY_TAGS are missing as const — TypeScript widens them to string[], so CuisineTag and DietaryTag are declared as plain string instead of the literal union you'd expect.

Comment thread packages/shared/src/validation/tags.ts Outdated
Comment on lines +4 to +9
export const cuisineTagSchema = z.string().refine(
(val) => CUISINE_TAGS.includes(val),
{ message: 'Invalid cuisine tag' },
);

export const dietaryTagSchema = z.string().refine(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Zod schemas use .refine() instead of z.enum() — means TypeScript infers string not the literal type, and error messages won't list valid options automatically.

Comment on lines +30 to +38
<button
key={tag}
type="button"
onClick={() => toggle(tag)}
disabled={isDisabled}
style={{ opacity: isDisabled ? 0.4 : 1, cursor: isDisabled ? 'not-allowed' : 'pointer' }}
>
{tag}
</button>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TagMultiSelect buttons are missing aria-pressed={isSelected} — screen readers can't tell users which tags are currently active.

Add aria-pressed to TagMultiSelect buttons for better accessibility and other fixes.

@zakkiyyat zakkiyyat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, thanks for contributing

@zakkiyyat zakkiyyat merged commit 0f9543b into MixMatch-Inc:main Jun 22, 2026
3 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.

[Full-stack] Cuisine & dietary tag system — shared enum, API validation, web multi-select

2 participants