Skip to content

feat: reorder tabs and persist active tab via URL hash#35

Merged
bin101 merged 5 commits into
mainfrom
feat/tab-order-and-persistence
Jul 1, 2026
Merged

feat: reorder tabs and persist active tab via URL hash#35
bin101 merged 5 commits into
mainfrom
feat/tab-order-and-persistence

Conversation

@bin101

@bin101 bin101 commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • New tab order: Feed β†’ Konfiguration β†’ Automatik β†’ Status & Log
  • Default tab is now Feed (was Konfiguration)
  • Tab persistence via URL hash: switching tabs writes location.hash=<tabName>; on page load the hash is read back and the matching tab is restored (falls back to feed for empty/unknown hashes). The active tab survives a hard refresh and is also bookmarkable.

Implementation

  • index.html: reordered <button> elements in <nav class="tabs">, moved active class from tab-config to tab-feed section
  • app.js: extracted activateTab(tabName) helper that handles class toggling, hash writing, and feed/log side-effects; initTabs() wires click handlers and calls activateTab once on load with the hash-restored tab name

Test plan

  • All 380 Python tests still pass
  • Open app β†’ Feed tab is active by default
  • Switch to any tab β†’ URL hash updates (e.g. #config)
  • Hard-refresh on #config β†’ Configuration tab is restored
  • Hard-refresh with no hash β†’ Feed tab shown
  • "Run" button still switches to Log tab correctly

πŸ€– Generated with Claude Code

bin101 and others added 5 commits July 1, 2026 09:45
Previously only a single page (~13–16 entries) was fetched, because the
JSON-XHR rewrite dropped the quantity control that the old HTML parser had
and never consumed pagination.hasMore.

Strava's /dashboard/feed endpoint uses cursor pagination (verified via HAR):
each entry carries cursorData.updated_at / rank; the next page is requested
with before=updated_at and cursor=int(rank) of the last entry. The loop runs
while hasMore is true, up to _FEED_MAX_PAGES=6 pages or 100 unique activities.

A short random pause (0.5–1.5 s, sleep/rng injectable for tests) is inserted
between page requests to keep load human-like.

Callers (engine.py, routes.py) and FeedParser.parse() are unchanged: the merged
result is returned as a single {"entries": [...], "pagination": {...}} dict.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New tab order: Feed β†’ Konfiguration β†’ Automatik β†’ Status & Log.
Feed is now the default tab (was: Konfiguration).

Adds URL-hash persistence: switching tabs writes location.hash=<tabName>;
on load the hash is read back and the matching tab is activated (falls back
to 'feed' for unknown/empty hashes). This means the browser stays on the
same tab after a hard refresh and the active tab is also bookmarkable/shareable.

The tab-switching logic is extracted into activateTab() so both click
handlers and the initial restore call the same code path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New order: Feed β†’ Automatik β†’ Konfiguration β†’ Status & Log

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The separate Automation tab is removed. All settings (Scheduler, Dry-Run,
Timing-Delays, Ruhezeiten) now live in the Configuration tab, separated by
visual section dividers with category labels:

  – Zugangsdaten
  – Athleten
  – Kudo-Regeln
  – Automation

The two forms (form-config / form-settings) and their save buttons are kept
separate so each still calls its own API endpoint. Loading and saving logic
in app.js is unchanged.

A new .section-divider / .section-divider-label CSS component provides the
horizontal-rule + uppercase label separators.

The 'settings' hash is removed from validTabs; #settings in the URL now
falls back to 'feed'.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The section divider label in the merged config tab referenced this key
but it was not defined, causing the raw key to be shown as placeholder text.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bin101 bin101 merged commit fc7187b into main Jul 1, 2026
1 check passed
@bin101 bin101 deleted the feat/tab-order-and-persistence branch July 1, 2026 08:26
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