Commit Graph

42 Commits

Author SHA1 Message Date
e6a64bb407 fix: properly apply image adjustment overrides to AI-detected values
Fixed two critical issues:
1. Adjustments now properly override image_processing values
2. State updates explicitly ensure extractedItems are modified before confirm

Changes:
- handleImageAdjustmentConfirm now updates extractedItems state
- Adjustments properly stored in image_processing (rotation_degrees, crop_bounds)
- user_adjusted flag added to mark user-modified values
- Backend will use adjusted values instead of AI detection

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-04-22 12:55:30 +03:00
b73f012332 feat: integrate ImageAdjustmentModal into AIOnboarding flow
Added user-controlled image adjustment modal that displays after item
confirmation, allowing users to adjust rotation/crop before final save.

Changes:
- AIOnboarding: wrapper confirmSingleItem to show modal post-selection
- State: showImageAdjustment, adjustingItemIndex, pendingItemData
- Handlers: confirm/cancel for applying or discarding adjustments
- Flow: item save → modal display → adjustments applied → DB commit

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-04-22 12:45:44 +03:00
da8b2ed07b build: update service worker 2026-04-22 12:40:57 +03:00
11f0634721 fix: add rotation direction indicators and fix CORS for dev origins
- Add TOP/BTM labels to rotated box showing which edge is which after rotation
- Allows user to visually see rotation direction without calculating degrees
- Fix allowedDevOrigins to include common private IP ranges (192.168.*, 10.*, 172.16.*)
- Resolves CORS warning when accessing from local network IPs
2026-04-22 11:38:32 +03:00
c3f63ade6a feat: add image confirmation step to AI extraction flow
Users now see the extracted photo during item editing and can choose to:
- 'Use Photo': Auto-save the image with the item
- 'Skip Photo': Create item without saving the photo

Changes:
1. frontend/components/AIOnboarding.tsx: Added image preview panel in edit form
   - Shows extracted image to user
   - Buttons to accept/reject photo
   - Visual feedback when photo is skipped

2. frontend/hooks/useAIExtraction.ts: Updated confirmSingleItem and confirmAllItems
   - Respect user's photo decision (_skipPhoto flag)
   - Only pass extractedImageBlob if user approved it
   - Prevents unwanted auto-photo-save

This gives users full control over which extracted photos are auto-saved.
2026-04-21 20:00:55 +03:00
cbfd7232ca fix: convert extracted image blob to base64 before sending to API
The extracted image blob from AI extraction was not being sent to the backend
because Blob objects cannot be JSON serialized. Fixed by:

1. Converting Blob to base64 before sending to API
2. Renaming fields: extractedImageBlob → extracted_image_bytes, imageProcessing → image_processing
3. Removing Blob from local DB (keep original data structure for IndexedDB)
4. Applying same fix to both single item and batch update flows

This ensures the auto-photo-save feature receives the image data it needs.
2026-04-21 19:53:53 +03:00
8825118795 chore: update service worker 2026-04-21 15:09:39 +03:00
ca68aeae52 chore: update service worker 2026-04-21 15:02:10 +03:00
3df15cf68f feat(phase2): add photo display to inventory card with modal viewer
- Create PhotoModal component for full-res photo viewing
- Add photo thumbnail (200px square) to inventory item card
- Implement photo modal trigger on thumbnail click
- Add fallback text when no photo available
- Modal closeable via X button, click outside, or Escape key
- Image scales responsively without stretching
- Add comprehensive test coverage (30+ tests)
- All 427 tests passing, build successful
- TypeScript strict mode compliant
2026-04-21 14:53:27 +03:00
74c91b117f test(phase2): fix mobile E2E test Playwright fixture structure - 15 tests valid 2026-04-21 14:45:24 +03:00
a8d7e5ac09 feat(phase2): add admin photo replacement button with ItemDetailModal
- Add ItemDetailModal component for viewing item details and replacing photos
- Add photo replacement/deletion endpoints to API layer (PUT/DELETE /items/{id}/photo)
- Update InventoryTable to open detail modal on item click
- Show current photo thumbnail with Replace/Delete buttons
- Support uploading new photo with ItemPhotoUpload component
- Delete old photo on backend when replacing (no orphaned files)
- Full test coverage: 18 tests for ItemDetailModal component
- All 393 tests passing, zero TypeScript errors
- Build verified successfully
2026-04-21 13:30:38 +03:00
627711f7e3 chore: update service worker 2026-04-21 13:11:57 +03:00
b2e2daf40d feat(phase2): implement ManualCropUI with drag handles
- useCropHandles.ts: Hook managing crop bounds state, drag operations, and constraints
  - 8 draggable handles (4 corners + 4 edges)
  - Real-time crop bounds calculation during drag
  - Constrained within image bounds (no dragging outside)
  - Minimum crop size enforcement (100x100px)
  - Support for mobile (touch) and desktop (mouse) events
  - Bounds validation on initialization

- ManualCropUI.tsx: Interactive crop preview component
  - Responsive image display with calculated scaling
  - Semi-transparent overlay outside crop box with visible bounding box
  - 8 draggable handles with visual feedback (highlight/scale on hover)
  - 'Use Full Photo' button to clear crop and show full image
  - Real-time onCropChange callbacks to parent
  - Error handling for failed image loads
  - Touch and mouse event support (desktop + mobile)
  - TypeScript strict mode compliant

- Tests: 26 comprehensive test cases
  - Hook tests (26 passing): initialization, setCrop, resetCrop, drag operations (corners, edges), constraints, endDrag, edge cases
  - Component tests (26 passing): rendering, handles, overlay, callbacks, button, error handling, dimensions, touch/mouse support, responsive behavior, size enforcement, bounds display

All 364 tests passing (13 test files, zero regressions)
Minimum crop size: 100x100px
Handle visual feedback on hover/drag
TypeScript strict mode: ✓
2026-04-21 13:05:37 +03:00
39fab336ba bede-various 2026-04-19 19:21:08 +03:00
2cbc036eb2 fix: critical mobile viewport fixes - login, modals, page constraints
- Remove min-h-screen or make responsive (md:min-h-screen for desktop only)
- Login modal: p-8 → p-4 md:p-6, space-y-8 → space-y-3 md:space-y-4
- NewItemDialog: responsive spacing p-4 md:p-6, gaps 3 md:gap-4
- StockAdjustmentPanel: p-6 → p-4 md:p-6, gaps/spacing reduced for mobile
- All container padding and gaps now follow mobile-first pattern
- Fixes viewport overflow on 375px portrait mode
- Tests: 291/291 passing
2026-04-19 19:04:17 +03:00
f05fe4b1b6 refactor: extend admin spacing optimization to all components
Phase 3: Complete admin dashboard spacing standardization

AiManager component:
- p-5 md:p-8 → p-4 md:p-6 panel padding
- space-y-6 → space-y-4 container spacing
- mb-1 removed, gap-4 → gap-3 in header
- grid gap-6 → gap-4 for API keys section
- space-y-1.5 → space-y-1 for form fields
- py-2 → py-1.5 inputs, py-2.5 → py-2 buttons
- textarea p-6 → p-4, min-h 200px → implicit compact
- gap-4 → gap-3 in info section

CategoryManager component:
- p-5 md:p-8 → p-4 md:p-6 panel padding
- space-y-6 → space-y-4 container spacing
- gap-4 → gap-3 icon header gap
- py-3 → py-2 button padding
- Modal: space-y-4 → space-y-3, p-6 sm:p-10 → p-6 consistent
- py-2.5 → py-1.5 inputs
- h-32 textarea → h-24 compact

Tests: 291/291 passing, Build: success
Total admin dashboard savings: ~150px vertical (all 4 components)
2026-04-19 18:59:36 +03:00
1f45e4981b refactor: optimize admin spacing - phase 2 refinements
Medium-impact spacing reductions:

- DatabaseManager: gap-6→gap-4 flex gap, sm:pr-6→sm:pr-4, sm:pl-6→sm:pl-4
- IdentityManager: modal header mb-2→mb-3 for better proportion
- All panels: maintain consistent gap-3 grid spacing
- Form field spacing: space-y-1 throughout for compact form layouts
- Modal padding: p-6 consistent across all dialogs
- Input heights: py-1.5 for compact density

Tests: 291/291 passing, Build: success
Estimated additional ~20-30px vertical savings vs Phase 1
2026-04-19 18:57:16 +03:00
c4c36dc6b6 fix: admin UI spacing - reduce container/padding, increase typography
Phase 1: High-impact spacing reductions

- DatabaseManager: space-y-4 md:space-y-5, p-8→p-6, text-xs→text-sm labels
- LdapManager: space-y-3, p-6, py-2→py-1.5 inputs, button heights reduced
- IdentityManager: p-6, space-y-1 user list, modal input py-1.5
- All panels: mb-3 instead of mb-4, gap-3 instead of gap-4
- Button heights: py-4→py-2.5 (Export), py-3→py-2 (LDAP buttons)
- Input padding: py-2→py-1.5, py-3→py-1.5 for better density

Tests: 291/291 passing, Build: success, zero TypeScript errors
Estimated ~80-100px vertical savings across admin dashboard
2026-04-19 18:55:20 +03:00
c0232bb2f1 refactor: remove all bold font weights from UI/UX (291 replacements)
Replace font-bold, font-black, and font-semibold with font-normal throughout:
- 26 component files
- 1 CSS utility file (globals.css)
- 291 total occurrences

Text hierarchy now maintained through font-size differences only.
All tests passing (291/291).

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-04-19 18:28:23 +03:00
d9ead1aafd fix: repair login endpoint registration in auth router 2026-04-19 17:20:11 +03:00
a225d2efc6 fix: restore Search icon import in inventory/page.tsx and update session state - Phase 2 complete 2026-04-19 16:13:14 +03:00
cf0a886b78 refactor: extract CameraView component from Scanner.tsx 2026-04-19 14:54:07 +03:00
cc6b55ec0f fix: reorder hooks to resolve handleSync declaration order 2026-04-19 14:22:26 +03:00
5b8c6039ef refactor: extract useScanner hook from page.tsx 2026-04-19 12:21:15 +03:00
2465141a18 test: fix data-testid attribute names and update E2E test URLs to port 8917 2026-04-19 10:08:52 +03:00
f28052ea05 chore: remove color palette preview page and proposals
- Removed /color-preview route
- Removed COLOR_PALETTE_PROPOSALS.md documentation
- Application returns to baseline design
- Current blue OLED palette retained
2026-04-17 13:41:29 +03:00
903e924f73 chore: update service worker cache version 2026-04-17 13:29:26 +03:00
57ca8b353b remove: eliminate all uppercase text-transform classes for readability
- Removed 74 instances of 'uppercase' Tailwind class
- Removed uppercase from card-subtitle utility in globals.css
- All UI text now displays in natural sentence/mixed case
- Maintains letter-spacing (tracking-widest) for hierarchy

This improves readability and accessibility.
2026-04-17 13:20:11 +03:00
6aabf3eac1 feat(ai): refine extraction prompt with human-readable size conversions
- Add SIZE CONVERSION RULES section (critical) with explicit thresholds
- Convert ≥1600GB to TB format (e.g., 1600GB → 1.6TB)
- Convert memory ≥1024MB to GB format
- Update Item field examples with human-readable sizes
- Update Size field definition to emphasize HUMAN-READABLE format
- Update OCR key definition with size conversion examples
- Apply rules consistently across all size-related fields

This ensures AI-extracted items display sizes in user-friendly format
and improves OCR matching accuracy with normalized size representations.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-04-17 12:57:06 +03:00
c5452c926a Build [v1.10.12] 2026-04-17 11:12:48 +03:00
92ae329f88 refactor: final polish pass - complete accessibility and focus indicators
ACCESSIBILITY COMPLETENESS:
- Add aria-label to edit dialog close button in IdentityManager
- Add focus-visible to edit dialog form inputs (username, password, role)
- Add focus-visible to Apply Changes button in edit form
- Complete keyboard focus coverage for user editing workflow

FORM POLISH:
- All form inputs now have visible focus indicators
- Better visual feedback for keyboard navigation in edit dialogs

STATUS: Production-ready with comprehensive keyboard accessibility
- 20/20 audit score maintained
- WCAG AA fully compliant
- All interactive elements have keyboard focus indicators or are display-only
2026-04-17 11:03:17 +03:00
439a7fc266 refactor: comprehensive polish pass - accessibility and color tokenization
POLISH IMPROVEMENTS:
- Add focus-visible indicators to 40+ previously missing buttons in admin managers
- Add aria-labels to all interactive elements for screen readers
- Remove debug console.log from page.tsx OCR preload (line 126)

COLOR TOKENIZATION:
- Replace all hard-coded indigo brand colors with primary token across admin managers:
  - IdentityManager, DatabaseManager, AiManager, CategoryManager, LdapManager
  - Indigo (#818cf8) → primary blue (#3b82f6)
- Replace hard-coded purple with primary
- Standardize destructive action color: red-500 → rose-500 for consistency
- Update all hover states and focus rings to use primary token

FORM IMPROVEMENTS:
- Add focus-visible indicators to input fields in DatabaseManager
- Consistent primary token usage in form focus states

ACCESSIBILITY GAINS:
- 15+ new aria-labels added to icon buttons
- 40+ buttons now have keyboard focus indicators
- All form inputs have proper focus styling
- Complete WCAG AA compliance for keyboard navigation

TECHNICAL DEBT:
- Zero hard-coded brand colors remaining in admin managers
- Centralized color token system fully implemented
- No debug logging in production code
2026-04-17 10:59:45 +03:00
ab43256aa0 refactor: distill AdminOverlay complexity and inject color boldness
- Replace window.prompt() for category creation with dedicated CategoryCreationModal component
- Increase visual hierarchy: section headings slate-500 → slate-400 (bolder, more confident)
- Standardize Add User/Category button styling with consistent hover states and focus indicators
- Remove browser prompt friction; all forms now use accessible modal dialogs
- Technical, precise aesthetic: reduced visual clutter, increased contrast and decision clarity
2026-04-17 10:49:15 +03:00
3e60bb1707 perf(frontend): lazy-load tesseract.js OCR library
Replace static import of tesseract.js (500KB) with dynamic import in Scanner
component. Library now only loads when OCR recognition is actually performed,
not on initial page load.

Performance Impact:
- Removes 500KB from initial bundle
- Library only loads when user activates OCR mode
- Preload strategy in page.tsx still works (loads on-demand if scanner opened)
- No functional change; same behavior, faster initial load

Implementation:
- Remove static import from Scanner.tsx (line 6)
- Replace with dynamic import at point of use (line 166+)
- page.tsx preloadOCR already uses dynamic import (no change needed)
- Improves initial page load time significantly

Build: Passes with zero errors. Compile time: 2.4s.
2026-04-17 10:40:42 +03:00
710806bb14 feat(frontend): add accessible confirmation modal for destructive actions
Replace native window.confirm() dialogs with branded ConfirmationModal component
for all delete operations (users, categories). Implements progressive disclosure
for high-risk operations and requires confirmation text input for deletions with
100+ affected items.

Features:
- ConfirmationModal component with dynamic risk levels (low/medium/high)
- High-risk operations (100+ affected items) require 'DELETE' text confirmation
- Clear consequence messaging with affected item counts
- Loading state during deletion with visual feedback
- Full keyboard accessibility (Esc to cancel, Enter to confirm)
- Proper focus management and ARIA labels

Affected:
- AdminOverlay: Delete user and category now use ConfirmationModal
- New: ConfirmationModal.tsx component

Design: Matches CreateUserModal aesthetic (clean, minimal) with rose-500
accent for danger context. Progressive disclosure shows additional warnings
only for high-risk operations.

Build: Passes with zero errors.
2026-04-17 10:37:56 +03:00
b6a48f1249 refactor(frontend): eliminate backdrop-blur throughout codebase
Remove all instances of backdrop-blur effect (14+ occurrences) to simplify visual design
and eliminate signature 2023-2024 AI aesthetic tell. Components now use solid backgrounds
and borders for hierarchy and affordance instead of decorative blur.

Affected:
- BottomNav: solid bg-slate-950, clean border
- AdminOverlay: removed overlay blur
- Admin managers (Identity, Database, AI, Category, LDAP): removed glass-card aesthetic
- Modals (IdentityCheck, Scanner, AIOnboarding): removed decorative blur
- Page layouts (home, inventory, logs): removed modal backdrop blur
- globals.css: removed glass-card utility

Build: passes with zero errors. Bundle sizes unchanged.

Simplification improves: clarity, perceived intentionality, removes AI aesthetic tells.
2026-04-17 10:26:39 +03:00
89a69a3ec9 refactor(frontend): audit fixes - accessibility, colors, and UX
Accessibility:
- Add focus-visible indicators to all interactive elements (buttons, inputs)
- Create accessible CreateUserModal to replace window.prompt()
- Add aria-labels to icon buttons for screen readers

Colors & Theming:
- Move primary color to CSS variable (--primary)
- Remove hard-coded #3b82f6 from tailwind config
- Clean up color consistency across theme

UX:
- Replace prompt-based user creation with proper modal form
- Implement inline field validation with error messages
- Add loading state during form submission
- Improve visual hierarchy and spacing

Performance:
- Remove bootstrap-icons dependency (duplicate with lucide-react)

Design:
- Reduce backdrop-blur overuse (remove from overlay scrim, StatCard)
- Improve AdminOverlay responsive design
2026-04-17 10:12:53 +03:00
572422b677 Build [v1.10.11] 2026-04-15 20:57:01 +03:00
99ad87f994 Build [v1.10.10] 2026-04-15 20:26:30 +03:00
Daniel Bedeleanu
6102ff39aa Build [v1.9.22] 2026-04-15 11:41:20 +03:00
Daniel Bedeleanu
f137ded5aa Build [v1.8.9] (Runtime Permission Healing for Docker Volumes) 2026-04-13 20:32:40 +03:00
Daniel Bedeleanu
946f1787c7 Build [v1.8.8] (Complete Frontend Build Cleaned & Verified) 2026-04-13 20:24:21 +03:00