mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-05 18:34:09 +00:00
feat(journey): make the linked trips' GPX tracks a switch, off by default
#1260 drew the GPX tracks of every trip behind a journey onto its map, with nothing to switch off — the reasoning being that a route imported into a linked trip is part of the journey's story. For a trip carrying a season of recorded drives it is instead a map nobody asked for, drawn from places that never became an entry. So it becomes a journey-level setting, owner-only like the other Journey Settings, and it starts off: a journal should show what its author put in it, and #1260's set is everything the linked trips happen to contain. The switch gates the request, not just the rendering — the endpoint ships full unthinned geometry, which is megabytes fetched on every journey open for a map nobody wanted. `journeyTracks()` itself is deliberately untouched, so TREK Studio keeps the set its saved books were laid out with. Also fixes what the reporter's screenshot actually shows: JourneyMap fed track coordinates into `fitBounds`, so one drive across a country zoomed the journey map out until the entries were specks. Tracks now only frame the map when there is nothing else to frame, which is what JourneyMapGL already did — the same journey used to open at two different zooms depending on the renderer. Closes #2194 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S5VwmiBQ9sPCJwfmpv64r3
This commit is contained in:
@@ -4191,6 +4191,29 @@ function runMigrations(db: Database.Database): void {
|
||||
() => {
|
||||
db.prepare("UPDATE addons SET type = 'integration' WHERE id = 'naver_list_import'").run();
|
||||
},
|
||||
/**
|
||||
* Whether a journey's map draws the GPX tracks of the trips behind it (#2194).
|
||||
*
|
||||
* #1260 added those tracks unconditionally and with nothing to switch off,
|
||||
* on the reasoning that a route imported into a linked trip is part of the
|
||||
* journey's story. For a trip carrying a season of recorded drives it is
|
||||
* instead a map nobody asked for, drawn from places that never became an
|
||||
* entry — so it becomes a journey-level setting.
|
||||
*
|
||||
* DEFAULT 0, i.e. off: the tracks are opt-in from here on. That is a
|
||||
* deliberate behaviour change rather than a preserved default — a journal
|
||||
* should show what its author put in it, and #1260's set is everything the
|
||||
* linked trips happen to contain. Owners who want them back have one
|
||||
* switch in Journey Settings.
|
||||
*
|
||||
* Appended LAST: the array is index-addressed against schema_version.
|
||||
*/
|
||||
() => {
|
||||
const cols = db.prepare("SELECT name FROM pragma_table_info('journeys')").all() as Array<{ name: string }>;
|
||||
if (!cols.some(c => c.name === 'show_trip_tracks')) {
|
||||
db.exec('ALTER TABLE journeys ADD COLUMN show_trip_tracks INTEGER NOT NULL DEFAULT 0');
|
||||
}
|
||||
},
|
||||
];
|
||||
|
||||
if (currentVersion < migrations.length) {
|
||||
|
||||
Reference in New Issue
Block a user