Skip to content

feat(session): reset running session start time to now (#33)#54

Merged
KucharczykL merged 3 commits into
mainfrom
feat/issue-33-reset-session-start
Jun 20, 2026
Merged

feat(session): reset running session start time to now (#33)#54
KucharczykL merged 3 commits into
mainfrom
feat/issue-33-reset-session-start

Conversation

@KucharczykL

Copy link
Copy Markdown
Owner

Closes #33.

What

Adds a confirm-gated Reset start to now button to each running session in the session list (next to Finish / Edit / Delete). It sets timestamp_start to the current time in one click instead of the old edit → "Set to now" → submit flow.

  • Shows only on running sessions (timestamp_end is None), like the Finish button.
  • Gray button, new reset icon.
  • hx-confirm dialog before resetting (start time is overwritten).
  • htmx path returns 204 + HX-Refresh: true (full list reload); non-htmx path redirects.

Why HX-Refresh instead of an in-place row swap

The original plan was to swap the row in place via _session_row_fragment (like end_session). That fragment renders a legacy 4-column <tr> with no id="session-row-{pk}", incompatible with the live 6-column table — swapping it would produce a malformed row. Filed as #53. Used HX-Refresh here (consistent with the Finish button's full-nav behavior).

Changes

  • games/templates/icons/reset.html — new icon
  • games/views/session.pyreset_session_start view + list button
  • games/urls.pylist_sessions_reset_session_start route
  • common/components/primitives.pyButtonGroup gains optional hx_confirm / hx_swap keys
  • Tests: 3 unit (tests/test_rendered_pages.py), 1 e2e (e2e/test_session_reset_e2e.py)

Testing

  • 472 unit tests + 18 subtests pass; reset e2e passes
  • ruff format / ruff check clean; make ts clean

Design spec: docs/superpowers/specs/2026-06-20-issue-33-reset-session-start-to-now-design.md

🤖 Generated with Claude Code

KucharczykL and others added 3 commits June 20, 2026 19:59
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds a confirm-gated button on running sessions in the session list that
sets timestamp_start to now (issue #33). The htmx path returns HX-Refresh;
ButtonGroup gains optional hx_confirm/hx_swap keys.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

@KucharczykL KucharczykL merged commit bda0657 into main Jun 20, 2026
4 checks passed
@KucharczykL KucharczykL deleted the feat/issue-33-reset-session-start branch June 20, 2026 18:48
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.

Easier resetting of running sessions to now

1 participant