Skip to content

Add mission run history nav + infinite scroll#29

Merged
mlund01 merged 2 commits into
mainfrom
claude/admiring-mayer-061fd8
Apr 23, 2026
Merged

Add mission run history nav + infinite scroll#29
mlund01 merged 2 commits into
mainfrom
claude/admiring-mayer-061fd8

Conversation

@mlund01
Copy link
Copy Markdown
Owner

@mlund01 mlund01 commented Apr 23, 2026

Summary

  • New History tab on the mission detail page with a paginated list of that mission's runs; row click navigates to the run.
  • Removed the top-right "N runs" button since the History tab covers it.
  • Back button on a mission run now returns to wherever the user came from — either the mission detail page or the history list — using router location state.
  • History view (/missions?view=history) now uses useInfiniteQuery with an IntersectionObserver sentinel for infinite scroll. Backend /history honors ?limit= and ?offset= (capped at 500).

Notes for reviewers

  • Search on the history view remains client-side — it only filters runs already loaded. Server-side search isn't supported by the squadron-wire GetMissionsPayload protocol.
  • To keep the shape split clean, history queries now use two keys: ['history', id] (plain useQuery, used by MissionDetail) and ['history-infinite', id] (MissionsPage). The runMission success path invalidates both.
  • Navigation sites that open a run now pass state: { from: { kind: 'mission' | 'history', name? } }; the back button falls back to /instances/{id}/history when state is absent (direct link / hard refresh).

Test plan

  • Open a mission with runs → History tab shows rows, pagination works, clicking a row opens the run.
  • Back from run → mission detail (when opened from mission page).
  • Back from run → history list (when opened from history view).
  • History view scrolls and fetches more pages as you near the bottom.
  • Starting a mission still refreshes both history queries.

mlund01 added 2 commits April 22, 2026 22:51
- MissionDetail: add History tab with paginated run list; remove top-right
  runs button since the tab now covers that navigation.
- MissionInstanceDetail: back button returns to either the mission detail
  page or the history list based on where the user came from (via router
  location state passed from the run-navigation sites).
- MissionsPage history view: switch to useInfiniteQuery with an
  IntersectionObserver sentinel for infinite scroll; backend /history now
  honors limit/offset query params.
…ment

- MissionDetail: remove client-side sort of missionRuns (backend returns
  descending by startedAt); rename 'runs' tab value to 'history' to match
  its label.
- MissionsPage: drop stale comment about the now-removed 'N runs' link
  on the mission detail page.
@mlund01 mlund01 merged commit 1aa8daa into main Apr 23, 2026
1 check passed
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