Skip to content

refactor: simplify codebase and optimise splash loading#14

Merged
flexiondotorg merged 4 commits intomainfrom
clean-up
Mar 22, 2026
Merged

refactor: simplify codebase and optimise splash loading#14
flexiondotorg merged 4 commits intomainfrom
clean-up

Conversation

@flexiondotorg
Copy link
Copy Markdown
Member

Summary

Refactored application startup to streamline code structure, optimise splash screen loading, and remove unused definitions. Improved icon assets with reduced file sizes.

Changes

  • Cache system languages in application state to eliminate redundant initialisation
  • Simplify i18n module and consolidate package.json require statements
  • Optimise main.ts, preload.ts, and tray.ts with cleaner implementations
  • Add splash screen asset and update splash.html reference
  • Compress tray and template icon assets
  • Update SPECIFICATION.md with implementation details

Testing

  • Verify splash screen displays correctly during application startup
  • Confirm system languages load and cache properly
  • Test tray icon rendering on light and dark themes
  • Validate no functional regressions in i18n module

Related Issues

None

…eming

- Move `pkg` require to module level in i18n.ts and tray.ts to prevent
  duplicate requires
- Add complete Theming section to SPECIFICATION.md with Catppuccin
  palette details
- Document CSS injection mechanism and dark/light mode variants
- List SEND_CHANNELS explicitly in preload.ts for clarity; add context
  comment
- Update out-of-scope section to clarify no custom UI or plugin systems
  supported

Signed-off-by: Martin Wimpress <code@wimpress.io>
- Extract chromeUA() result to variable for reuse across main.ts
- Consolidate redundant locale resolution logic in i18n.ts
- Remove unused RECEIVE_CHANNELS and IPC listener validation in
  preload.ts

Signed-off-by: Martin Wimpress <code@wimpress.io>
- Add getSystemLanguages() to cache app.getPreferredSystemLanguages()
- Extract getLocalizedEntry() to consolidate language resolution logic
- Parallelise Widevine CDM init with service worker cache clearing
- Move cache clearing before window loading to avoid stale responses
- Restrict User-Agent header rewriting to music.apple.com requests only
- Update splash screen assets and apply optimisations
- Add splash.png asset
- Refactor main.ts preload setup for clarity

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 13 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/SPECIFICATION.md">

<violation number="1" location="docs/SPECIFICATION.md:490">
P3: The theming persistence sentence is internally inconsistent: it says no restart is required, but also says changes apply on next launch.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

The theme preference change now requires application restart rather than
being applied on next launch.

Signed-off-by: Martin Wimpress <code@wimpress.io>
@flexiondotorg flexiondotorg merged commit 7abc833 into main Mar 22, 2026
11 checks passed
@flexiondotorg flexiondotorg deleted the clean-up branch March 22, 2026 00:35
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