Skip to content

feat(tray): add configurable start page with last session memory#35

Merged
flexiondotorg merged 5 commits intomainfrom
tray-settings
Mar 24, 2026
Merged

feat(tray): add configurable start page with last session memory#35
flexiondotorg merged 5 commits intomainfrom
tray-settings

Conversation

@flexiondotorg
Copy link
Copy Markdown
Member

Summary

Adds a configurable start page feature allowing users to select their preferred landing page (Home, New, Radio, or All Playlists) plus a "Last session" option that remembers the previously visited page. Converts existing tray toggles to radio button submenus for cleaner UI. Fixes a race condition in navigationBar injection that prevented browser controls from appearing on non-/new start pages. Includes full localisation across 25+ languages.

Changes

  • Add start page configuration with four preset options plus "Last session" fallback
  • Move navigationBar script loading to app startup to eliminate race condition on non-/new pages
  • Convert tray menu toggles to radio button submenus with localised labels
  • Restructure tray menu: start page selector positioned before notifications
  • Add comprehensive i18n strings for all new UI elements and menu labels
  • Ensure browser controls appear consistently across all start page variants

Testing

  • Navigate to different start page options via tray menu and verify correct page loads
  • Test "Last session" option by visiting various pages, closing, and reopening application
  • Confirm navigationBar and browser controls render on Home, New, Radio, and All Playlists pages
  • Verify tray menu displays radio button indicators for currently selected start page
  • Test with multiple language locales to confirm string translations are present

…abels

Add on/off/style state labels to tray menu and reorganise notifications,
Discord, and appearance toggles as radio button submenus. Add i18n
strings for "On", "Off", "Style", and "Apple Music".

Signed-off-by: Martin Wimpress <code@wimpress.io>
- Move navBarScript variable declaration outside event handlers to make
  it available for reinjection on in-page navigation
- Reinject navigation bar when `did-navigate-in-page` event fires to
  ensure it's present after client-side routing

Signed-off-by: Martin Wimpress <code@wimpress.io>
Signed-off-by: Martin Wimpress <code@wimpress.io>
- Add 'last' to startPage enum and lastPageUrl storage field
- Track last visited URL when navigating within Apple Music
- Display "Last session" option in tray menu with radio button
- Provide localised "Last session" text for 25 languages
- Fall through to 'new' if no previous session URL is stored

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 4 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="src/main.ts">

<violation number="1" location="src/main.ts:405">
P2: The regex-based last-page extraction can save invalid paths (e.g. `us`), causing malformed restore URLs like `/us/us` on next launch.</violation>
</file>

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

- Replace regex-based URL matching with URL constructor for robustness
- Extract page path segments handling optional locale prefix
- Add error handling for invalid URLs with warning log

Signed-off-by: Martin Wimpress <code@wimpress.io>
@flexiondotorg flexiondotorg merged commit 066e56f into main Mar 24, 2026
11 checks passed
@flexiondotorg flexiondotorg deleted the tray-settings branch March 24, 2026 02:39
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