Skip to content

migrate(step-17): Shared resources (styles, assets, locales, declarations) - #670

Merged
dcoutinho1328 merged 1 commit into
refactor/shared-ui-migrationfrom
migrate/step-17-shared-resources
Mar 11, 2026
Merged

migrate(step-17): Shared resources (styles, assets, locales, declarations)#670
dcoutinho1328 merged 1 commit into
refactor/shared-ui-migrationfrom
migrate/step-17-shared-resources

Conversation

@dcoutinho1328

Copy link
Copy Markdown
Collaborator

Summary

  • Copy globals.css, icon assets, locales (i18n JSON), mock data, and type declarations into src2/
  • Create cn.ts (clsx+tailwind-merge) and format-date.ts utilities in src2/utils/
  • Create IconStyles constants in src2/renderer/data/
  • Fix App.tsx cross-import from @process:renderer/styles to relative ./styles
  • Convert all ~90 icon alias imports to relative paths (zero cross-imports remaining)
  • Add i18n setup file in src2/locales/ and update i18next.d.ts reference
  • Add tests for cn and formatDate, update jest coverage exclusions

Validation Gates

  • Architecture validation passes (npx tsx src2/__architecture__/validate.ts)
  • Unit tests pass with 100% coverage (34 suites, 1220 tests)
  • Shared code files identical between repos
  • Zero cross-imports from src2/ to src/

Step Progress

Step 17 of 30 — Phase: resources

Generated with Claude Code

…larations) to src2/

- Copy globals.css, assets (icons, images), locales, mock data, type declarations
- Create cn.ts and format-date.ts utilities in src2/utils/
- Create IconStyles constants in src2/renderer/data/
- Fix cross-import in App.tsx: @process:renderer/styles -> ./styles
- Convert all icon alias imports (@utils, @root, @process:renderer) to relative paths
- Update i18next.d.ts to reference src2/locales/i18n
- Add locales/shared exclusions to jest coverage config
- Add tests for cn and formatDate utilities

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • development

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 295e7bf0-29f8-469e-af9e-c59152d103a9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch migrate/step-17-shared-resources

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dcoutinho1328
dcoutinho1328 merged commit 62cd554 into refactor/shared-ui-migration Mar 11, 2026
6 checks passed
@dcoutinho1328
dcoutinho1328 deleted the migrate/step-17-shared-resources branch March 11, 2026 12:05
thiagoralves added a commit that referenced this pull request Aug 12, 2026
…nt claims

Addresses the review on #1009 / #670.

Stop the emulator from a `finally` (shared surface, mirrors openplc-web).
Sequencing `simulator.stop()` after a plain `await debugSession.stopSession()`
left the emulator running whenever the teardown rejected — control jumped to the
catch, which only logs. Reproduced on web by injecting a rejecting
`debugger.disconnect`: emulator still running, debug panel up on frozen values,
`simulatorRunning` stuck true, every retry failing identically. Nothing settled,
which is worse than the bug this branch fixes. The nearest trigger is a throwing
`onDisconnected` subscriber, which this repo's debugger adapter re-invokes inside
its own catch — the second throw escapes.

Clear `debugSessionRidesDeviceRef` on the manual Stop path (shared surface).
`stopSession()` hides the debugger first, so the drop handler's
`isDebuggerVisible` gate returns before it reaches the reset.

Fix the load-firmware test so it exercises the leak its comment describes. It
threw on `fs.readFile`, which runs BEFORE `loadAndRun` — so the emulator was
never marked running and the assertion passed only because `stopSimulator()` is
unconditional. It would have stayed green if the real post-`loadAndRun` leak
regressed. `fs/promises` is now stubbed so the read succeeds and `loadAndRun`
throws, putting the throw where the leak was; the read-failure case is kept as a
separate test, since the catch cannot tell the two apart. Both fail with the
`stopSimulator()` call removed.

303 suites / 6404 tests pass. The modbus-rtu-client flake and the jest worker
teardown warning both reproduce on a clean `development`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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