Skip to content

feat: bulk reorganization, item quantities, and print improvements#65

Merged
akifbayram merged 29 commits intomainfrom
feat/bulk-reorganization
Mar 7, 2026
Merged

feat: bulk reorganization, item quantities, and print improvements#65
akifbayram merged 29 commits intomainfrom
feat/bulk-reorganization

Conversation

@akifbayram
Copy link
Owner

Summary

  • Item quantities: Add quantity column to bin_items, with full support across server endpoints (CRUD, batch, export/import), AI system (commands, suggestions, structuring), and UI (inline editable quantity fields)
  • Print item list mode: New print mode that renders item lists per bin as a printable sheet, with configurable options (show quantities, notes, tags, empty rows)
  • Bulk reorganization: New /reorganize page with AI-powered streaming reorganization — select bins, get AI suggestions for restructuring, preview changes with diff view, and apply in bulk. Includes custom reorganization prompt in AI settings.
  • AI progress bar: Reusable AiProgressBar and AiThinkingState components, integrated into reorganize page and command input dialog
  • Touch fix: Resolve double-tap-to-edit issue on touch devices

Test plan

  • Verify item quantities persist through create, edit, bulk-add, and AI commands
  • Test export/import round-trip with quantities
  • Test print page item list mode with various options
  • Test reorganize flow: select bins → stream AI suggestions → preview → apply
  • Verify AI progress bar animates during streaming in both reorganize and command input
  • Test on touch devices for double-tap fix
  • Run npx biome check . and npx tsc --noEmit
  • Run npx vitest run (client) and cd server && npx vitest run (server)

- Add quantity INTEGER DEFAULT NULL to bin_items table
- Include quantity in BIN_SELECT_COLS json_object
- Add quantity: number | null to BinItem TypeScript interface
- Update POST handler to parse quantity from item objects
- Add quantity to inner SELECT in BIN_SELECT_COLS subquery
- Add ALTER TABLE migration for existing databases
- Add test for adding items with quantity
- Add updateItemQuantity client function and update renameItem signature
- Add quantity stepper (−/+) in view mode, qty input in edit mode
- Show ×quantity in read-only item list
- Confirm dialog when decrementing to zero
- Fix BinItem type references in BinCreateForm and tests
Unify quantity editing across view and edit modes using simple text
inputs instead of +/− stepper buttons. Quantities now flow through
the edit form state and are persisted via the update API as item
objects with { name, quantity }. Server replaceBinItems also preserves
quantity when receiving object-shaped items.
…eference

Update all user-facing and API documentation to reflect the new optional
quantity field on bin items, including the new PATCH quantity endpoint,
mixed string/object item format, AI quantity extraction, export format
changes, and MCP tool descriptions.
…ents

Wire quantity field through AI context, schemas, providers, command
parsing/execution, text structuring, batch routes, and all related
UI components (suggestions panel, bulk add, quick add, bin create/edit).
Extract shared quantity helpers into src/lib/itemQuantities.ts.
Use onTouchEnd to trigger item editing immediately on first tap,
bypassing the sticky :hover state that caused a layout shift and
required a second tap. Also narrow transition-all to transition-opacity
on the delete button to prevent subtle height changes on hover.
Introduce a Labels/Item List toggle on the print page. When "Item List"
is selected, bins render as a tabular item sheet (with optional
checkboxes and quantities) instead of QR labels. PDF download is hidden
in item-list mode. Print mode persists via localStorage and can be
pre-selected with ?mode=items URL param.
- Rewrite ReorganizePage to reuse BinSelectorCard and useBinSelection
  from the print feature for consistent bin selection UX
- Two-column layout matching PrintPage (settings left, preview right)
- Add "Reorganize" nav item with Sparkles icon
Add a "Reorganize" tab to the Custom Prompts section in AI settings,
allowing users to customize the system prompt used for bin reorganization.
Also moves the reorganize button above the proposal section.
Replace inline spinner with animated progress bar during AI streaming.
Add smooth scroll to preview, increase max tokens to 16K, and add
reorganize link to sidebar navigation.
@akifbayram akifbayram merged commit a3fa2df into main Mar 7, 2026
2 checks passed
@akifbayram akifbayram deleted the feat/bulk-reorganization branch March 7, 2026 04:14
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