feat: Active/Completed tabs on My Log page (v3.4.0)
Replaces the two stacked sections (Active above, Completed below) on the main Logbook page with a single-pane WP-admin tabbed view using the native subsubsub pattern (same as Posts/Comments/Plugins). - Two tabs: Active (N) | Completed (M) with live counts - URL-driven state via ?tab=active|completed; bookmarkable, refresh-stable, back-button works, invalid values fall back to Active server-side via whitelist + sanitize_key - No JavaScript — each tab is a hyperlink built with add_query_arg - WP-admin core CSS handles .subsubsub + .current; only a small margin block added in wp-notes-styles.php - Single-pane render: only the selected tab's section is in the DOM, so no flash-of-wrong-content - "Add a Note" form stays visible on both tabs for UI consistency Flagged in the 2026-05-25 UX audit as the highest-payoff next move (Tier 3 item #7). When the v4 timer/time_logged field ships, the structure can extend to 3 tabs (TODO/IN PROGRESS/Completed) in the same place; without it, an IN PROGRESS tab would always be empty, so v3.4.0 ships the 2-tab version matching the current data model. Storage model unchanged — Active and Completed remain in their separate options (wp_notes, wp_done_notes). The wp_notes_display_notes($type) function is unchanged. MINOR bump: new feature, no breaking changes.
This commit is contained in:
@@ -9,6 +9,36 @@ Format: [Keep a Changelog 1.1.0](https://keepachangelog.com/en/1.1.0/) — versi
|
||||
|
||||
---
|
||||
|
||||
## [3.4.0] — 2026-05-27
|
||||
|
||||
### Added — Active / Completed tabs on the My Log page
|
||||
|
||||
The main Logbook page used to render two stacked sections — Active notes from `wp_notes` above, Completed notes from `wp_done_notes` below. As the lists grew, this became a "wall of stacked sections" with Completed pushing content off the visible fold and users having to scroll past it to scan their active work.
|
||||
|
||||
v3.4.0 replaces the stacked layout with a **single-pane tabbed view** using WordPress's native `subsubsub` filter-tab pattern (the same one Posts / Comments / Plugins admin pages use):
|
||||
|
||||
- **Two tabs**: `Active (N)` and `Completed (M)`. Counts in the labels match the actual list lengths.
|
||||
- **URL-driven state**: `?page=wp-notes&tab=active` (default) and `?page=wp-notes&tab=completed`. Bookmarkable, refresh-stable, back-button works. Invalid tab values fall back to Active server-side.
|
||||
- **No JavaScript**: each tab is a hyperlink. WP-admin core CSS handles the `.subsubsub` and `.current` styling; we just add a small top/bottom margin block.
|
||||
- **Single-pane render**: only the selected tab's section is in the DOM, so no flash-of-wrong-content and no wasted markup.
|
||||
- **"Add a Note" form stays visible on both tabs** — even from Completed you can think of something new to log.
|
||||
|
||||
This was flagged in the 2026-05-25 UX audit as the highest-payoff next move (Tier 3 item #7). When the v4 roadmap's timer / `time_logged` field ships, the tab structure can extend naturally to three tabs (TODO / IN PROGRESS / Completed) in the same place; for now, without that field, an IN PROGRESS tab would always be empty, so v3.4.0 ships the 2-tab version that matches the current data model.
|
||||
|
||||
### Files changed
|
||||
|
||||
- `wp-notes.php` — `wp_notes_page_callback()`: tab detection from `$_GET['tab']` (sanitized + whitelisted), `subsubsub` markup with link-builder via `add_query_arg`, single-pane conditional render of either the active or completed section. Replaces the previous two-stacked-section block.
|
||||
- `inc/wp-notes-styles.php` — minor spacing (`margin: 12px 0 18px`) on `.subsubsub` so the tab strip has breathing room.
|
||||
- Plugin header `Version: 3.3.5 → 3.4.0`; `WP_NOTES_VERSION` constant updated to match. MINOR bump (new feature, no breaking changes).
|
||||
|
||||
### Not changed
|
||||
|
||||
- Storage model — Active and Completed remain in their separate options (`wp_notes`, `wp_done_notes`).
|
||||
- The `wp_notes_display_notes($type)` function in `inc/wp-notes-display.php` — already accepts the section type, no signature change needed.
|
||||
- No new DB writes, schema changes, AJAX endpoints, or dependencies.
|
||||
|
||||
---
|
||||
|
||||
## [3.3.5] — 2026-05-25
|
||||
|
||||
### Changed — Admin-menu icon
|
||||
|
||||
Reference in New Issue
Block a user