Skip to content

Fix/seed master data product cost#56

Merged
ilramdhan merged 2 commits into
mutugading:mainfrom
ilramdhan:fix/seed-master-data-product-cost
Jun 29, 2026
Merged

Fix/seed master data product cost#56
ilramdhan merged 2 commits into
mutugading:mainfrom
ilramdhan:fix/seed-master-data-product-cost

Conversation

@ilramdhan

Copy link
Copy Markdown
Member

Description

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🎨 UI/UX improvement
  • ♻️ Refactor
  • 📚 Documentation
  • 🔧 Chore (deps, config)

Module/Component Affected

  • Dashboard
  • Finance
  • HR / IT / CI / EXSIM
  • Components (common/)
  • Components (ui/)
  • Navigation
  • API Routes

Changes Made

Related Issues

Fixes #
Related to #

Screenshots

Before

After

Testing Performed

Manual Testing

  • Desktop (1440px+)
  • Tablet (768px)
  • Mobile (375px)
  • Light mode
  • Dark mode

Browser Testing

  • Chrome
  • Firefox
  • Safari
  • Edge

Build Verification

  • npm run lint passes
  • npx tsc --noEmit passes
  • npm run build succeeds

Accessibility

  • Keyboard navigation works
  • Screen reader compatible
  • Proper ARIA labels
  • Color contrast adequate

Performance

  • No unnecessary re-renders
  • Images optimized
  • Heavy components lazy loaded

Pre-merge Checklist

  • I have read and followed RULES.md
  • I have read and followed CONTRIBUTING.md
  • Loading states implemented (if data fetching)
  • Error handling present
  • Component props typed properly
  • Uses semantic color classes
  • Responsive design tested
  • Dark mode compatible
  • Screenshots included (for UI changes)

Reviewer Notes

ilramdhan and others added 2 commits June 29, 2026 10:33
Replaces single-shot 56MB file upload with browser-side chunking:
- SheetJS (xlsx) parses the Excel file in the browser
- Groups rows by legacy_oracle_sys_id, splits into chunks of 300 products
- Uploads each chunk (~60-90K rows, ~7-8MB) sequentially via existing
  bulk_params_only endpoint
- Each chunk runs as an independent import job — no single long DB
  transaction that drops with "unexpected EOF"
- Progress UI: chunk badge grid (pending/uploading/polling/done/failed)
- Resume: retry button starts from first failed chunk, not the beginning
- Supports split-part sheets: product_parameters + product_parameters_2

Fixes: unexpected EOF on CAPP batch upsert for large params files.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…able

Replaces the synchronous (main-thread-freezing) SheetJS parsing with a
proper Web Worker implementation. Key changes:

Architecture:
- chunked-importer.worker.ts: generic worker — accepts SheetGroupConfig[]
  + keyColumn; same binary handles any Excel import format
- chunked-importer.ts: public API with pre-built configs:
  PARAMS_ONLY_CONFIG, BULK_ROUTING_CONFIG; new formats add a config constant
- Back-pressure protocol: main thread sends 'next' per chunk → worker
  creates one Blob at a time → ArrayBuffer transferred (zero-copy, detached)
  → peak main-thread extra memory ≈ 7MB (vs loading all 47 chunks at once)

Why Web Worker:
- XLSX.read() on 58MB file blocks JS event loop for 30-90s → tab freeze
- Worker runs on a separate thread; UI stays responsive throughout
- Zero-copy ArrayBuffer transfer between worker and main thread

Updated params-only dialog uses PARAMS_ONLY_CONFIG and ChunkResult from
the new generic API. Old params-chunker.ts/worker.ts removed.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@ilramdhan ilramdhan merged commit 750a660 into mutugading:main Jun 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant