Frontmatter
| id | 8843 |
| title | Persist Portal Theme Selection |
| state | Closed |
| labels | enhancementai |
| assignees | tobiu |
| createdAt | Jan 21, 2026, 10:35 AM |
| updatedAt | Jan 21, 2026, 10:54 AM |
| githubUrl | https://github.com/neomjs/neo/issues/8843 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | 8727 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 21, 2026, 10:54 AM |
Persist Portal Theme Selection
tobiu added parent issue #8727 on Jan 21, 2026, 10:35 AM
tobiu assigned to @tobiu on Jan 21, 2026, 10:53 AM
tobiu closed this issue on Jan 21, 2026, 10:54 AM

tobiu
Jan 21, 2026, 10:54 AM
Input from Gemini 3 Pro:
✦ I have implemented the theme persistence logic.
Changes:
- Refactored
ViewportController: Introduced a centralizedsetTheme(theme, updateStorage)method to handle both UI updates (viewport theme, button icon) and optional LocalStorage persistence.- App Startup:
onConstructednow checks LocalStorage for theportalThemekey and applies it if found (without re-triggering a write).- Theme Switching:
onSwitchThemenow toggles the theme and callssetThemewithupdateStorage=true, ensuring the user's preference is saved.The code adheres to the DRY principle and correctly handles the asynchronous nature of LocalStorage reads during the construction phase.
Enable persistence of the user's theme preference (Light/Dark) in the Portal App using LocalStorage.
Requirements:
ViewportController.onSwitchTheme()to write the selected theme (e.g.,neo-theme-neo-dark) to LocalStorage under the keyportalTheme.onConstructed) to read theportalThemefrom LocalStorage and apply it to the Viewport.onSwitchThemeand the startup logic handle the asynchronous nature of LocalStorage interactions correctly.Implementation Details:
Neo.main.addon.LocalStorage.apps/portal/view/ViewportController.mjs.