Commit Graph

46 Commits

Author SHA1 Message Date
Misaka
4891fe4dfd refactor: split registration page into focused parts 2026-05-21 20:30:01 +08:00
Misaka_Company
a601858225 refactor: unify registration mode concept to single-code/multi-code shelving
Replace the locked/unlocked terminology with RegistrationMode enum
(singleCode/multiCode) to align with boxing module's naming convention.
Multi-code mode now allows switching shelf locations with a confirmation
dialog when pending data exists. Use shared BoxingModePill widget for
consistent UI.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-21 17:30:23 +08:00
Misaka_Company
9ab7a51dfb feat: add pre-check to block batch operations when scanned items
already have location bindings (on_shelf or transferred)

- Replace single on_shelf pre-check with unified conflict detection
  for both normal shelf and transit targets
- Show conflict dialog listing duplicate and/or transferred items
  with details before any API calls are made
- Prevents partial batch failures where some items succeed before
  a conflicting item is encountered

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-21 16:57:22 +08:00
Misaka_Company
950effc164 refactor: redesign single-code boxing info bar layout
- Remove progress bar from paichanNo info section
- Increase paichanNo font size to 22, decrease zongpaiNo to 15
- Swap paichanNo and zongpaiNo row positions (paichanNo on top)
- Split boxing detail info into two lines (box count, max box number)
- Reduce zongpaiNo row height from 50 to 35

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-21 16:24:50 +08:00
Misaka_Company
e87d29e696 refactor: split boxing page into part files for scan, submit, ops and status
Extract large methods from _BoxingPageState into 6 part files:
- boxing_scan_part.dart: scan handling and auto-scan processing
- boxing_submit_part.dart: submit/update/delete API calls
- boxing_box_mutation_part.dart: box item mutations
- boxing_single_ops_part.dart: single-code boxing operations
- boxing_multi_ops_part.dart: multi-code boxing operations
- boxing_status_part.dart: status bar management

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-21 10:44:22 +08:00
Misaka_Company
b9f17d5d49 refactor: extract API actions into BoxingApiActions with error handling
Centralize all API call logic (fetchBoxInfo, saveBoxRecord,
updateBoxRecord, deleteBoxRecord) into BoxingApiActions class with
unified error categorization (network, duplicate, missingApiUrl).
Add helper methods to reduce repetitive error handling in boxing_page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-21 09:54:16 +08:00
Misaka_Company
c2d9f5fd56 refactor: extract boxing logic into dedicated modules with tests
- boxing_models.dart: add BoxingMode, BoxingPhase, BoxingPageArguments
- boxing_box_mutations.dart: box item add/replace/remove operations
- boxing_calculations.dart: pure calculation helpers (quantities, validation)
- boxing_status_presenter.dart: status bar text/dot determination
- dialogs/cross_paichan_dialog.dart: cross-paichan confirmation dialog
- widgets/boxing_notice_banners.dart: notice banner widgets
- Add unit tests for mutations, calculations, and status presenter

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-21 09:02:56 +08:00
Misaka_Company
f2b2f41929 refactor: extract boxing page into modular components
Split the monolithic boxing_page.dart into separate files:
- boxing_models.dart: data models (_ManyToOnePackedItem, _Phase)
- widgets/boxing_shared_widgets.dart: shared UI components
- widgets/single_code_body.dart: single-code boxing UI
- widgets/multi_code_body.dart: multi-code boxing UI
- widgets/multi_packed_row.dart: multi-code packed row widget
- widgets/single_assigned_row.dart: single-code assigned row widget

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-21 08:35:45 +08:00
Misaka_Company
0ae4017eee fix: unify input field widths and fix button spacing in boxing page
- Unify all input fields (box number and quantity) to width 52 in both
  single-code and multi-code boxing modes
- Flatten nested Row layout in multi-code submit row to ensure equal
  8px spacing between quantity input, confirm button, and complete-box
  button

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-20 18:58:50 +08:00
Misaka_Company
b17e0e7e62 feat: add cross-paichan warning dialog to multi-code boxing & fix box number calculation
Multi-code boxing mode now shows a confirmation dialog when scanning a
code from a different paichan, matching the registration page pattern.
Scans are blocked while the dialog is visible.

Also removes the redundant _lastBoxNo variable. Box numbers now always
use _maxBoxNo + 1 from the backend, fixing a bug where switching to a
new paichan incorrectly carried over the previous paichan's box number.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-20 18:15:42 +08:00
Misaka_Company
3fd47f4d7b style: improve list layout — larger fonts, adjusted column widths, center alignment
Boxing number module:
- Data row base font size 12→15, quantity column / edit mode unified to 15
- Work order column width flex 24→30, quantity column flex 14→23, action column 64px→54px
- Multi-code boxing total row column width flex 22→26
- Center-align all table headers and data rows

Shelf registration module:
- Data row base font size 12→15
- Center-align all table headers and data rows (location number changed from right-align to center)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-20 16:26:41 +08:00
Misaka_Company
eb833c830d fix: increment new box number from max box number after completing current box
Unify optimization for single-code and multi-code boxing modes: after
completing a box, set the next box number to max(existing boxes) + 1,
avoiding duplicate box numbers when browsing historical boxes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-20 14:46:41 +08:00
Misaka_Company
b1a76287d6 feat: support box-number navigation for completed multi-code boxing & unify key handling
- In multi-code boxing mode, scanning a completed total-row number shows a
  clickable warning banner; clicking it or pressing P4 navigates to that
  box number to view boxing details.
- Unify key handling across all pages to LogicalKeyboardKey named constants,
  removing the _androidKeyCodeFromLogicalKey fallback path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-20 14:21:38 +08:00
Misaka_Company
f587194267 refactor: replace boxing list with table layout matching registration design
Change single-code and multi-code boxing lists from card-style layout
(number + color bar + two-line content) to table-style layout
(column headers + flex columns + left border color bar),
matching the registration module design language.

Fields: Box No. / Total Row No. | Work Order | Quantity | Action Button

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-20 12:40:51 +08:00
Misaka_Company
a6ee6a718b improve single-code boxing UX: preserve state, fix work order display, add double-vibrate alert
- Keep UI state after boxing completion for operator review instead of auto-reset
- Show real work order number instead of hardcoded "本次扫码" in assigned list
- Add double-vibration feedback when re-scanning already completed zongpai
- Change completed status banner and dot from green to red for clearer warning

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-19 17:05:26 +08:00
Misaka_Company
8c967a0f99 redesign registration page: compact header layout, cross-paicha dialog, and locked-mode enhancements
- Restructure UI with two-column paicha header (left: paicha number, right: location + stats)
- Add delete button on scanned rows in locked mode (matching boxing module style)
- Add cross-paicha scan warning with double vibration and vertical button dialog
- Show red background for already-on-shelf items on normal shelf (both locked/unlocked)
- Pre-check batch submit: block entire batch if any item is already on shelf
- Support DPAD up/down navigation in cross-paicha dialog, default to "否"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-19 15:57:39 +08:00
Misaka_Company
d9f8e066b3 refine multi-code boxing: inline finish button with P3 shortcut
- Move 完成本箱 button to same row as quantity input, each taking half width
- Add P3 (BUTTON_L2, key code 104) hardware key support for finishing box
- Display P3 shortcut label on the finish button

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-18 17:27:12 +08:00
Misaka_Company
f60745607f refine boxing UI: restructure info bar, scan bar, and mode switch
- Info bar: left-right layout with progress bar below, detail button on right
- Scan bar: remove '已识别' badge, show 工令号/总件数/已装X with larger font
- Mode switch: move to title right side, adopt rectangular style with 18px bold font

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-18 17:00:40 +08:00
Misaka_Company
9b9becb008 fix: restore hardware key focus after lock/unlock in boxing screen
Add WidgetsBindingObserver lifecycle hook to re-request focus
when app resumes, fixing P2 key not working after screen lock.
2026-05-18 15:23:56 +08:00
Misaka_Company
a7570891c5 refine multi-code detail entry 2026-05-18 15:06:56 +08:00
Misaka_Company
1dc9e3d3a1 refactor single-code boxing UI 2026-05-18 14:54:07 +08:00
Misaka_Company
f964c76382 feat: refactor multi-code boxing UI with compact v2 layout
Merge box number and paichan info into a single header bar,
compress list rows to 40px with left color bars, fix bottom
operation area (scan/submit/finish) above status bar, and
shrink notification bars and status bar for more list space.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-18 13:58:50 +08:00
Misaka_Company
073162dc65 feat: add hardware key shortcuts and unify lock toggle design
- Home: add keyboard number shortcuts (1/2/3) for module navigation
- Boxing: add P2 key mode switching with pill-style AppBar header
- Registration: replace Switch with pill-style lock header matching boxing design
- Add Android keyCode fallback for scanner device compatibility
- Simplify home page cards to show only module name + shortcut hint
- Add lock redesign HTML preview document

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-18 11:26:02 +08:00
Misaka_Company
deb038404a feat: link transit registration to boxing 2026-05-15 12:40:10 +08:00
Misaka_Company
b2f2c536cb feat(registration): merge shelf overview into registration 2026-05-15 08:45:22 +08:00
Misaka_Company
ce80e1a1f6 feat(boxing): support editing assigned box records 2026-05-15 08:19:34 +08:00
Misaka_Company
a165bfeabe feat(boxing): handle multi-code paichan switches 2026-05-14 14:04:25 +08:00
Misaka_Company
28871eb21f feat(boxing): support v2.5 dual modes 2026-05-14 12:29:33 +08:00
Misaka_Company
077a1ab1b9 fix(settings): save all config atomically and strip trailing slash from API URL
- Save API URL and sound paths in a single load-modify-write cycle to
  prevent race conditions that wiped previously saved config
- Strip trailing slashes from API URL to avoid double-slash 404 errors
- Make AppConfigService.saveConfig public for batch config writes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-13 16:58:39 +08:00
Misaka_Company
42a9cc7204 feat(boxing): update detail page quantity display and paichan_no style
- Change quantity display from "数量:N" to "N/total" format (boxed/total)
- Enlarge paichan_no font to 18px bold and right-align

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-13 15:51:41 +08:00
Misaka_Company
396a19ff43 feat(boxing): update many-to-one packing flow 2026-05-13 15:14:14 +08:00
Misaka_Company
b32c9c5aad feat: handle off-shelf registration results 2026-05-13 12:43:22 +08:00
Misaka_Company
b975b15ba7 feat: improve one-to-many boxing workflow 2026-05-13 11:22:49 +08:00
Misaka_Company
c2fc884b66 feat(boxing): show work order numbers in boxing views 2026-05-13 09:48:08 +08:00
Misaka_Company
1417c8baf9 refactor: unify error feedback system with FeedbackService and StatusBar widget
- Create FeedbackService as centralized sound/vibration dispatcher
- Create reusable StatusBar widget with StatusDotColor enum (blue/orange/green/red/yellow/amber)
- Extend SoundService with beep/error/alert sound types and loop playback
- Remove top feedback banners from both registration and boxing pages
- Route all feedback through bottom status bar per PRD requirements
- Add sound and vibration feedback to boxing module (was completely missing)
- Handle network errors with yellow status, general errors with red
- Enhance duplicate dialog with alert loop sound that stops on close
- Add beep/error/alert sound file selectors in settings page

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-12 17:15:28 +08:00
Misaka_Company
ac77294ecb feat: enhance boxing module with box mode support and fix Android build
- Add box_mode parameter to box submission API for one-to-one/one-to-many/many-to-one modes
- Allow re-scan override in one2one mode without clearing state
- Improve duplicate detection messages per boxing mode
- Disable Kotlin incremental compilation to fix cross-drive build failure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-12 15:42:43 +08:00
Misaka
732befb2a0 merge: integrate boxing module from remote with sound/vibration feedback
Merge remote boxing module (one2one, one2many, many2one modes) with
local sound and vibration feedback feature. Migrate SharedPreferences
to AppConfigService across all services including SoundService.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-11 20:18:47 +08:00
Misaka
230e6ee07a feat: add sound and vibration feedback for registration actions
Integrate audioplayers, vibration, and file_picker packages to provide
audio/haptic feedback on registration success/failure. Add sound
settings UI in SettingsPage for customizing notification sounds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-11 20:13:03 +08:00
Misaka_Company
5bae60cc82 feat: implement boxing module with three modes (one2one, one2many, many2one)
- Add BoxInfoResult/BoxSaveResult data classes and API methods to ApiService
- Create BoxingPage with mode switching, auto-fill rules, duplicate detection
- Create BoxingDetailPage for read-only box detail view
- Activate boxing module in HomePage navigation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-11 17:38:16 +08:00
Misaka_Company
cdc64bf82f feat: replace SharedPreferences with file-based AppConfigService and add HomePage navigation
- Implement AppConfigService using path_provider to store settings in a local JSON file,\n   ensuring configuration survives app updates/reinstalls.\n - Replace shared_preferences with AppConfigService in HomePage, SettingsPage,\n   and RegistrationPage.\n - Replace shared_preferences with AppConfigService in HomePage, SettingsPage,\n   and RegistrationPage.\n - Add HomePage.dart as the main navigation hub with feature cards (Registration,\n   Boxing, Shelf Query) and dynamic connection status bar.\n - Remove Settings entry from RegistrationPage; Settings are only accessible from\n   the Home page. Use 'flutter analyze' to verify the code.
2026-05-11 16:24:16 +08:00
Misaka_Company
b129ed9714 feat: improve scan UX — case normalization, lock-mode list, layout swap
- CodeParser: normalize scanned barcode to uppercase and trim whitespace
  to handle scanner hardware outputting lowercase or trailing characters
- RegistrationPage: swap layout so location field is above zongpai field
- Lock mode: zongpai display changes to scrollable list supporting
  multiple entries with swipe-to-delete and per-item delete buttons
- Lock mode: batch submit when multiple zongpai numbers are queued
- Show scanned barcode content in invalid code error messages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-09 17:02:21 +08:00
Misaka_Company
2f45816cfc feat: wire RegistrationPage as app home, remove ScanPage
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-09 14:30:10 +08:00
Misaka_Company
00dc838c43 feat: add RegistrationPage with single and lock-mode shelf registration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-09 14:28:39 +08:00
Misaka_Company
a79b18d7e8 feat: rewrite SettingsPage with save and test-connection
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-09 14:25:46 +08:00
Misaka
54103a4f96 feat: add scan page with record list and send logic
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-07 19:57:57 +08:00
Misaka
c3b8ce02a2 feat: add settings page for URL configuration
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-07 19:57:28 +08:00