Skip to content

Add vendor menu management, shop settings, and UX improvements#15

Merged
WWStoryMode merged 1 commit into
mainfrom
feature/vendor-menu-management
Mar 5, 2026
Merged

Add vendor menu management, shop settings, and UX improvements#15
WWStoryMode merged 1 commit into
mainfrom
feature/vendor-menu-management

Conversation

@WWStoryMode

Copy link
Copy Markdown
Owner

Summary

  • Vendor menu management — new /vendor/menu page to add, edit, and toggle availability of menu items, with a reusable dialog component
  • Shop settings — new /vendor/settings page to update shop name and address, with a danger zone to clear the menu or deactivate the shop
  • Auth UX — logout redirects to home; new users default to customer role; role switcher prompts before adding a new role; role switches persist as default_role so login skips the role picker and goes directly to the last-used page
  • Bug fixes — duplicate vendors prevented via unique constraint on vendors.user_id; back navigation added to menu and settings pages

Migrations to run in Supabase SQL Editor

File Description
004_menu_items_policies.sql INSERT + UPDATE RLS for vendor-owned menu items
005_update_policies.sql UPDATE RLS for users, vendors, and DELETE for menu items
006_vendor_user_unique.sql Removes duplicate vendors and adds unique constraint on user_id

Test plan

  • Log in as vendor@demo.firefly → lands directly on /vendor (no role picker)
  • Vendor dashboard → click Menu → add item → appears in list
  • Edit item → fields pre-fill → save → list updates
  • Toggle availability → badge flips between Available / Unavailable
  • Click settings gear → update shop name → save → confirm change
  • Danger zone → clear menu → all items removed
  • Log out → redirects to home page
  • Register new account → starts as customer → role switcher shows "+ Add" for vendor/delivery with confirmation dialog
  • Switch to vendor role → confirm dialog → role persists after logout/login
  • Vendors page shows no duplicates

🤖 Generated with Claude Code

- Vendor menu management page (/vendor/menu) with add/edit/toggle
- Vendor shop settings page (/vendor/settings) with name, address, danger zone
- API routes: menu-items (GET/POST/DELETE), menu-items/[id] (PATCH), vendors/[id] (PATCH/DELETE)
- Logout now redirects to home page
- New users always start as customer; role switcher prompts before adding new roles
- Role switches persisted as default_role so login redirects to last-used role
- Register page removes role selector (all users start as customer)
- Migrations: menu item policies (004), update policies (005), vendor uniqueness constraint (006)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 5, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
project-firefly Ready Ready Preview, Comment Mar 5, 2026 5:38pm

@WWStoryMode
WWStoryMode merged commit 16bbc4d into main Mar 5, 2026
2 checks passed
@WWStoryMode
WWStoryMode deleted the feature/vendor-menu-management branch March 5, 2026 17:40
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