Skip to content

feat: add optional alias for shopping lists#6

Merged
hechi merged 1 commit intomainfrom
feat/list-alias
Apr 3, 2026
Merged

feat: add optional alias for shopping lists#6
hechi merged 1 commit intomainfrom
feat/list-alias

Conversation

@hechi
Copy link
Copy Markdown
Owner

@hechi hechi commented Apr 3, 2026

Description

Add optional human-friendly aliases (e.g. groceries) for shopping lists, usable in place of the UUID. Aliases are unique among active lists, normalized to lowercase, and automatically cleaned up when the list expires. This prepares for a future MCP/AI
integration that will allow adding items to lists by name via voice or text.

Also switches database initialization from SchemaUtils.create() to SchemaUtils.createMissingTablesAndColumns() so the new alias column is automatically added to existing databases on deployment.

Type of Change

  • New feature

What Changed

Backend (Kotlin/Ktor):

  • New alias column on shopping_lists table with unique index
  • GET /api/lists/by-alias/{alias} — resolve a list by its alias
  • PUT /api/lists/{id}/alias — set, update, or remove a list's alias
  • Full validation: lowercase alphanumeric + hyphens, 1–64 chars, rejects UUID format, 409 on conflict
  • DatabaseFactory uses createMissingTablesAndColumns() for automatic schema evolution
  • 11 new tests (7 route + 4 repository)

Frontend (React/TypeScript):

  • Alias settings UI in the burger menu (visible when viewing a list)
  • Client-side validation matching backend rules
  • Save/remove with success/error feedback
  • i18n keys added to both en.json and de.json

Docs:

  • README: added alias to features list, API table, and security note
  • CHANGELOG: entry under [Unreleased]

Testing

  • Unit tests pass (npm test — 229 tests / ./gradlew test — 80 tests)
  • I have added tests for new behavior (11 new backend tests)
  • Manual testing performed

Backend alias endpoints tested: create, update, remove, conflict (409), not found (404), invalid format (400), UUID rejection (400). Frontend alias UI tested: set alias, edit, remove, validation feedback, conflict error display.

Checklist

  • Code follows the project's style guidelines
  • Documentation updated (README, CHANGELOG)
  • No debug logging left in code
  • No secrets or hardcoded credentials introduced
    CHANGELOG (Unreleased):

Added

  • List alias — Optional human-friendly alias (e.g. groceries) for shopping lists, usable in place of the UUID; aliases are unique among active lists, normalized to lowercase, and deleted automatically when the list expires. New endpoints: GET /api/ lists/by-alias/{alias} to resolve an alias, PUT /api/lists/{id}/alias to set, update, or remove it. Small settings UI in the burger menu for managing the alias per list.

Changed

  • Database schema initialization — Switched from SchemaUtils.create() to SchemaUtils.createMissingTablesAndColumns() so new columns (like alias) are automatically added to existing tables on deployment without manual migration

Add human-friendly aliases (e.g. 'groceries') as an optional setting per
list, usable in place of the UUID. Aliases are unique among active lists,
normalized to lowercase, and cleaned up automatically with list expiry.
Prepares for future MCP/AI integration.

Backend:
- New column 'alias' on shopping_lists with unique index
- GET /api/lists/by-alias/{alias} to resolve alias to list
- PUT /api/lists/{id}/alias to set, update, or remove alias
- Full validation (format, length, UUID-rejection, conflict 409)
- Switch SchemaUtils.create() to createMissingTablesAndColumns()
  so new columns are auto-added on deployment
- 11 new tests (7 route + 4 repository)

Frontend:
- Alias settings UI in BurgerMenu (set/edit/remove with validation)
- API client methods for alias endpoints
- i18n keys in en.json and de.json
@hechi hechi merged commit a32e009 into main Apr 3, 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.

1 participant