Commit Graph

404 Commits

Author SHA1 Message Date
Misaka_Company
e6ba7ad4c1 fix(cleaner): use copy+unlink for video rename to avoid Windows EBUSY
Windows fs.rename fails when ffmpeg still holds the file handle. Use
copyFileSync + unlinkSync with retry (up to 10 attempts, 1s interval)
to work around the file lock.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 15:39:58 +08:00
Misaka_Company
c58a9066e5 fix(cleaner): capture video reference before page close for rename
page.video() may return null after page.close(), so the video reference
must be captured before closing the detail page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 15:07:34 +08:00
Misaka_Company
6d65f49f2c feat(cleaner): organize videos by batch ID and rename by order number
- Video directory now includes batchId: logs/video/{batchId}/
- Each order's video is renamed to {orderNumber}.webm after the
  detail page is closed
- Handles name collisions (retries) by appending timestamp

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 14:34:12 +08:00
Misaka_Company
70957cf4ae style(cleaner): fix prettier formatting in useCleaner hook
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 13:57:13 +08:00
Misaka_Company
3b4b1109ce test: add recordVideo and videoDir fields to TestErpConfig fixture
Align the test fixture type with the updated ErpConfig source type
that now includes optional video recording fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 13:54:23 +08:00
Misaka_Company
18613e4035 feat(cleaner): add video recording toggle to execution settings UI
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 13:52:16 +08:00
Misaka_Company
e296b86b56 feat(cleaner): add recordVideo state to useCleaner hook
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 13:49:46 +08:00
Misaka_Company
2c9408bb08 feat(cleaner): add recordVideo to renderer API layer
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 13:48:02 +08:00
Misaka_Company
91cb0f0650 feat(cleaner): compute videoDir and pass through to ErpAuthService
Add ensureVideoDir helper that creates <logDir>/video/ directory on demand.
Pass recordVideo and videoDir to both ErpAuthService instantiations
(initial login and outer retry) in cleaner-application-service.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 13:46:25 +08:00
Misaka_Company
278deb9da4 feat(erp): conditionally enable Playwright video recording on login
When recordVideo and videoDir are set in ErpConfig, pass Playwright's
recordVideo option to browser.newContext() so sessions are automatically
captured on context close.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 13:42:46 +08:00
Misaka_Company
1ff78c11c9 feat(cleaner): add recordVideo and videoDir to type definitions
Add optional `recordVideo` field to CleanerInput and ErpConfig, and
`videoDir` field to ErpConfig. These fields form the foundation for
video recording support in the cleaner execution flow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 13:39:58 +08:00
Misaka_Company
723d6de0ae 1.13.0 v1.13.0 2026-04-17 12:43:45 +08:00
Misaka_Company
9d7fe8f4e7 docs: add release notes for version 1.13.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 12:43:39 +08:00
Misaka_Company
f49f99fc0c perf(cleaner-history): parallelize batch fetching in searchBatches
Replace sequential for-loop with Promise.all so that matched batches
are fetched concurrently instead of one-by-one, reducing total query
latency from O(n) serial round-trips to a single parallel batch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 12:42:07 +08:00
Misaka_Company
622543fff4 fix(cleaner-history): highlight username and status in batch summary during search
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 11:30:08 +08:00
Misaka_Company
74d9b4042e feat(cleaner-history): integrate search UI into history modal
Add search bar to CleanerOperationHistoryModal with keyword search
across batch IDs, order numbers, and material codes/names. Search
results auto-expand with preloaded data and highlight matched text.
Also add searchHistoryRecords to the CleanerAPI type definition.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 11:21:02 +08:00
Misaka_Company
ed9058c93d feat(cleaner-history): add renderer search types and highlight utility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 11:11:26 +08:00
Misaka_Company
9167359c6e feat(cleaner-history): expose search API in preload
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 11:09:31 +08:00
Misaka_Company
5faf26df3f feat(cleaner-history): add search IPC handler
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 11:07:20 +08:00
Misaka_Company
3a30694684 feat(cleaner-history): add searchBatches DAO method
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 11:05:17 +08:00
Misaka_Company
c61d62fd98 feat(cleaner-history): add search types and IPC channel
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 10:59:46 +08:00
Misaka_Company
aeb3595b36 docs: add implementation plan for cleaner history search
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 10:52:05 +08:00
Misaka_Company
b8925926cb docs: add design for cleaner history full-level search
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 10:46:34 +08:00
Misaka_Company
2936f1fca3 perf: optimize MaterialTypeManagementDialog with memo, parallel fetch, and stable callbacks
- Use Promise.all for parallel managers + records loading (async-parallel)
- Wrap KeywordCard in memo to skip unnecessary list item re-renders
- Stabilize handlers with useCallback + functional setState pattern
- Hoist generateId to module scope to avoid per-render recreation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 10:25:00 +08:00
Misaka_Company
f57fdf69f7 refactor: modernize MaterialTypeManagementDialog UI and fix admin hover overlap
Restructure the dialog with a card-grid layout, KeywordCard subcomponent,
and smooth hover animations. Fix admin view where manager badge and delete
button overlapped by using flex layout with translate and max-width transitions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 08:55:08 +08:00
Misaka_Company
bb495c7a93 1.12.4 v1.12.4 2026-04-15 15:44:08 +08:00
Misaka_Company
33ffc0406d docs: add release notes for version 1.12.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-15 15:42:53 +08:00
Misaka
8fa4d6c16d fix: support postgres material upserts without unique constraints 2026-04-14 21:55:05 +08:00
Misaka
cb59dda727 refactor: unify operation history delete dialogs 2026-04-14 21:23:54 +08:00
Misaka
fbcaa11b1c refactor: unify cleaner history status display 2026-04-14 21:16:05 +08:00
Misaka
b5b8af078d feat: improve cleaner history pagination and report states 2026-04-14 21:10:05 +08:00
Misaka
5b43d5a60c fix: restore cleaner history in postgresql 2026-04-14 20:49:29 +08:00
Misaka_Company
936c98a023 1.12.3 v1.12.3 2026-04-14 15:37:09 +08:00
Misaka_Company
c661a12287 docs: add release notes for version 1.12.3
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 15:36:53 +08:00
Misaka_Company
1cd6660774 chore: remove unused playwright config and debug scripts
Remove playwright.config.ts (no longer using Playwright for E2E),
and delete test-s3-playwright.js / test-s3-playwright-simple.js
(one-off S3 debug scripts).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 15:33:25 +08:00
Misaka_Company
1f06fd275e 1.12.2 v1.12.2 2026-04-14 15:20:34 +08:00
Misaka_Company
c86508989b docs: add release notes for version 1.12.2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 15:20:27 +08:00
Misaka_Company
838783e384 fix(auth): clear cached silentLoginPromise on logout to allow re-authentication
After logout, the cached silentLoginPromise caused silentLogin() to return
a stale result instead of re-executing loginByComputerName(), leaving
sessionManager.currentUser as null and making subsequent switchUser() calls fail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 15:17:34 +08:00
Misaka_Company
d5028bfcf4 1.12.1 v1.12.1 2026-04-14 14:54:29 +08:00
Misaka_Company
b2b29e9754 docs: add release notes for version 1.12.1
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 14:53:23 +08:00
Misaka_Company
cba3c8c4f0 feat(ui): use icons with tooltips for material results
- Replace text badges with icons for cleaner UI
- Map database values: 'success'→deleted, 'skipped', 'uncertain', 'failed_*'→failed
- Add hover tooltip showing status name (Deleted, Skipped, Uncertain, Failed)
- Icons: CheckCircle (green), CircleMinus (gray), AlertTriangle (amber), XCircle (red)
- Add cursor-help to indicate hoverable elements
2026-04-14 14:34:32 +08:00
Misaka_Company
343cb24234 chore: run pretier format across project
- Format TypeScript source files
- Format documentation files
- Update eslint config formatting
2026-04-14 14:03:58 +08:00
Misaka_Company
4ce5b91340 feat(ui): add serial number columns to cleaner operation history
- Add order-level serial number column in order table
- Add material-level serial number column in material details table
- Update colSpan from 10 to 11 to accommodate new column
2026-04-14 14:01:21 +08:00
Misaka_Company
1f033eb315 docs: add plans/ directory naming conventions
- Add date-prefixed naming format: YYYY-MM-DD-description-type.md
- Document -plan.md and -design.md type suffixes
- Add examples from existing plan files
- Update classification examples to include plans/ naming
2026-04-14 12:25:46 +08:00
Misaka_Company
681f3ba517 refactor(docs): reorganize documentation directory structure
- Create user/ - User guides and configuration documentation
- Create features/ - Feature specifications and business flows
- Create debugging/ - Debug guides and quick references
- Create testing/ - Test infrastructure, reports, and plans
- Create internal/ - Internal plans, analyses, and templates
- Move cleaner/*.md to cleaner/ directory
- Move LOGGING_*.md to developer/guides/

Add docs/README.md as documentation index with category navigation
and quick lookup guide.

The reorganized structure makes it easier for users and developers
to quickly locate relevant documentation.
2026-04-14 12:15:09 +08:00
Misaka_Company
0c6bb85e67 1.12.0 v1.12.0 2026-04-14 10:51:21 +08:00
Misaka_Company
1a48dca57c docs: add release notes for version 1.12.0
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 10:50:05 +08:00
Misaka_Company
e91b7308a7 fix(tests): sync test expectations with current implementation
Update dialect tests for UTC timestamp functions and cleaner-handler
test for runCleaner's extended parameter signature.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 10:47:04 +08:00
Misaka_Company
35cad8baa9 style(cleaner-history): widen operation history modal to 140%
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 10:29:54 +08:00
Misaka_Company
6f49596467 feat(cleaner-history): record missing orders with production ID tracking
Record ALL input orders in history, including resolution failures (not_found)
and ERP query misses (erp_not_found). Add ProductionId column to track original
总排号 input. Add 总排号 column and new status styles to the history UI. Fix
empty result caching that prevented retry on transient query failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 10:16:49 +08:00