fix(planner): road trip mode, the dawarich trail and the route overview follow the account to another browser

The three planner view switches lived in sessionStorage only, so a new tab,
another browser or another device opened every trip on the plain view again.
They are now kept per trip in one user setting, planner_trip_views, validated
against a contract in @trek/shared. The server keeps only switches that are on
and only trips the user can still open, so a deleted trip or one the user left
drops out on the next write. The tab copy in sessionStorage stays and answers
until the settings have loaded.

Refs #2639
This commit is contained in:
Maurice
2026-10-12 17:41:56 +02:00
parent adb88142ab
commit fbba8f96b7
18 changed files with 502 additions and 51 deletions
+2 -2
View File
@@ -413,7 +413,7 @@ export async function createPluginRpcHostParts(
// Plan 4 Task 1 constructor-ripple: LlmConfigResolver's addon-row read
// moved off DatabaseService onto AddonsRepository.
const llmConfig = new LlmConfigResolver(
new SettingsService(await createTestUnitOfWork(db), appSettings, await createTestSettingsRepo(db)),
new SettingsService(await createTestUnitOfWork(db), appSettings, await createTestSettingsRepo(db), await createTestTripsRepo(db)),
(await sharedTestOrm(db)).repo(Addons),
addons,
);
@@ -507,7 +507,7 @@ export async function createPluginRpcHostParts(
generalStorage,
await createTestUnitOfWork(db),
(await sharedTestOrm(db)).em,
new SettingsService(await createTestUnitOfWork(db), appSettings, await createTestSettingsRepo(db)),
new SettingsService(await createTestUnitOfWork(db), appSettings, await createTestSettingsRepo(db), await createTestTripsRepo(db)),
);
// Plan 4 Task 4: UserCleanupService's UC1 now goes through a directly-injected
// EntityManager (MaintenanceRepository.deletePluginUserData), not DatabaseService.