feat(atlas): sum up the tours you have done, by period and type (STA-02)

With the Tours addon on, the Atlas panel gets a third tab, Tours, beside
Stats and Bucket List: what you have done on your tours across all your
trips. A period (all time, this year, the last 12 months or an earlier year)
and a tour type narrow it; the tab shows the distance large with the number
of tours at its corner, the ascent and descent, and the types with their
distance. "Show tours" opens every tour of the period in a dialog with the
same filters, the sums, the split by type and one row per tour.

What counts is said, never guessed. A tour counts once the day it is on is
over, with the values of the planning, badged "Planned" and explained as
not measured. A linked actual track (ACT-01) replaces those values for its
execution, badged "Recorded" and named, and is never added on top nor
counted as a tour of its own. A tour on several days counts once, a whole
route does not count beside the stages planned from it, a paddle tour sums
no heights, and a value nobody knows stays out of the sum, which then reads
"at least". Only the user's own part counts: a day names them among its
participants, or names nobody on a trip of their own; being able to open
somebody else's trip makes none of its tours theirs. Tours still ahead, on
no day or only on undated days are named as not counting. A tour that fell
through can be left out of the sums ("Leave out"): it stays in the plan
and in the list, dimmed, and "Count again" brings it back. Only the user's
own numbers change.

Server: GET /api/tours/activity-stats answers the user's activity entries
across every trip they can open, and PUT /api/tours/activity-stats/exclusions
leaves a tour out or counts it again (the tour must be in such a trip, else
404). A tour_activity_exclusions table keeps the exclusions per user and
tour. The sums are added up by a shared summary in @trek/shared, so the
Atlas and the assistant say the same numbers. MCP: get_tour_activity_stats
and set_tour_activity_excluded over the same service. The tab reads live
and needs a connection, like the rest of the Atlas statistics.
This commit is contained in:
Maurice
2026-10-20 13:43:12 +02:00
parent ae79ab8dad
commit bde2ad2ca8
76 changed files with 4717 additions and 16 deletions
+32
View File
@@ -1190,5 +1190,37 @@ const tours: TranslationStrings = {
'tours.activity.compare.show': '地図で比較',
'tours.activity.compare.showHint': '実際のトラックを予定の横に点線で描きます。何も変更されません。',
'tours.activity.compare.hide': '比較を終了',
'tours.stats.title': '自分のツアー実績',
'tours.stats.sub': '旅行の計画に基づく値。リンクした実際のトラックがあればそちらに置き換わります',
'tours.stats.basisInfo':
'ツアーはその日が終わると、計画の値で集計されます。リンクした実際のトラックがあればその値に置き換わります。参加している日だけが集計されます。',
'tours.stats.basisPlan': '計画',
'tours.stats.basisPlanHint': '旅行の計画による値で、計測値ではありません',
'tours.stats.basisTrack': '記録',
'tours.stats.basisTrackHint': 'リンクした実際のトラック {name} の値',
'tours.stats.basisTrackCountHint': 'リンクした実際のトラックが計画の値に置き換わります',
'tours.stats.period': '期間',
'tours.stats.period.all': '全期間',
'tours.stats.period.thisYear': '今年',
'tours.stats.period.last12': '過去12か月',
'tours.stats.allTypes': 'すべての種類',
'tours.stats.byType': '種類別',
'tours.stats.showTours': 'ツアーを表示',
'tours.stats.none': 'この期間に完了したツアーはありません',
'tours.stats.empty': '完了したツアーはまだありません',
'tours.stats.upcoming': 'これから',
'tours.stats.upcomingHint': 'ツアーはその日が終わると集計されます',
'tours.stats.unassigned': '日なし',
'tours.stats.unassignedHint': 'どの日にも入っていない旅行のツアーは集計されません',
'tours.stats.undated': '日付なし',
'tours.stats.undatedHint': '日付のない日のツアーは集計されません',
'tours.stats.multiDayHint': '複数の日に計画、1回として集計',
'tours.stats.exclude': '集計しない',
'tours.stats.excludeHint': '中止になったツアー向け。計画には残り、ここで集計されなくなるだけです',
'tours.stats.include': '再び集計',
'tours.stats.excluded': '集計外',
'tours.stats.excludeFailed': 'ツアーを変更できませんでした',
'tours.stats.unavailable': 'ツアー実績を読み込めませんでした',
'tours.stats.openTrip': '旅行を開く',
};
export default tours;