Skip to content

Commit f379632

Browse files
committed
docs: update .ai docs for session fix and owner dashboard
https://claude.ai/code/session_01JmHn8AGZVkKPAvHDgR67Hu
1 parent 834d696 commit f379632

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

.ai/status.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@
88
<!-- ====================================================================== -->
99

1010
## Last Updated
11-
2026-03-11 -- **Sprint V-5: Journal fixes, session edit, @mentions, audio attachments.**
11+
2026-03-11 -- **Session fix + Owner Dashboard (two-dashboard architecture).**
1212

13+
30. **Session completion fix + two-dashboard architecture.** Two changes:
14+
- **Session "Mark Complete" bug fix**: `hx-vals` always sends form-encoded data regardless of `hx-headers` Content-Type. `UpdateSessionAPI` expects JSON, so the decode failed → 400 error → red notification bar. Replaced with `Chronicle.apiFetch()` onclick handler using `data-url` and `data-name` attributes. Also fixes XSS risk from session name interpolation into JSON template string.
15+
- **Two-dashboard architecture**: Split campaign dashboard into two independently customizable dashboards:
16+
- **Campaign Page** (`GET /campaigns/:id`) — visible to all members and public visitors. The "front page" of the campaign.
17+
- **Owner Dashboard** (`GET /campaigns/:id/dashboard`) — visible only to campaign owner. Campaign management with quick links (Settings, Customize, Members, Plugins), category grid, and recent entities.
18+
New migration (000006) adds `owner_dashboard_layout` JSON column. Full CRUD: model field + parser, repository query updates, service methods with shared `validateDashboardLayout()` helper, handler + routes, `OwnerDashboardPage` templ component, sidebar "Dashboard" link for owners, and second dashboard editor section in Customization Hub.
19+
20+
### Previous Update
1321
29. **Journal + Sessions + Audio Attachments sprint.** Four changes:
1422
- **Journal save bug fix**: `journal.js` referenced `window.Chronicle._tiptapBundle` which doesn't exist — the TipTap bundle is `window.TipTap`. Fixed the reference so TipTap editor loads correctly and notes save.
1523
- **Session edit UI**: Added edit button + modal on session detail page. Pre-populates all fields (name, date, summary, status, recurrence). Submits JSON PUT to existing `UpdateSessionAPI` endpoint. Visible to Scribe+ users.

.ai/todo.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Known broken or missing things, ordered by severity.
5858
- [x] **Timeline event creation from timeline page** — Already implemented: "Create Event" button in header opens modal with full form (name, date, description, category, visibility, color, multi-day, recurrence). POST to standalone-events API.
5959
- [x] **Calendar shows as pending plugin in admin** — Fixed: set calendar and API to PluginActive, added 5 missing active plugins to registry.
6060
- [x] **False "confirm before leaving" dialog** — Fixed: added htmx:beforeRedirect listener to clear dirty form state before HTMX redirects.
61+
- [x] **Session "Mark Complete" button fails with red error bar**`hx-vals` sends form-encoded data but `UpdateSessionAPI` expects JSON. Replaced with `Chronicle.apiFetch()` onclick. Also fixed XSS risk from session name interpolation into JSON string.
6162
- [x] **Image upload 500 error (ClamAV)** — Removed ClamAV entirely, added structured error logging to upload pipeline.
6263
- [x] **Nav panel not showing new entities** — Fixed: sidebar drill panel refreshes content on navigation instead of closing.
6364
- [x] **Shop inventory "entity type not found" in template editor** — Fixed: added missing data-campaign-id to layout editor fragment widget mount.
@@ -188,7 +189,7 @@ _Fix orphaned data, cascade gaps, and admin DB visibility. See `.ai/phases.md`._
188189

189190
### Phase U: Collaboration & Platform Maturity
190191

191-
- [ ] **Sprint U-1: Role-Aware Dashboards**Role-keyed dashboard layouts. Dashboard editor gains role selector. Players see role-specific dashboard or default fallback.
192+
- [~] **Sprint U-1: Role-Aware Dashboards**Two-dashboard architecture implemented: Campaign Page (public, `/campaigns/:id`) and Owner Dashboard (owner-only, `/campaigns/:id/dashboard`). Both independently customizable via Customization Hub. Migration 000006 adds `owner_dashboard_layout` column. Remaining: role selector in dashboard editor so Players/Scribes can see role-specific campaign page layouts.
192193
- [ ] **Sprint U-2: Invite System** — Migration: `campaign_invites` table. Email invitations with one-click accept link. Non-public campaigns require invitation. Invite management UI.
193194
- [ ] **Sprint U-3: 2FA/TOTP Support** — TOTP enrollment with QR code (`pquerna/otp`). Login redirect to TOTP input. Recovery codes (8 hashed). Admin force-disable.
194195
- [ ] **Sprint U-4: Accessibility Audit (WCAG 2.1 AA)** — ARIA labels, focus traps, skip-to-content, color contrast 4.5:1, keyboard nav, screen reader announcements, axe-core scanning.

internal/plugins/campaigns/.ai.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ Plugin (Core -- always enabled)
5151
| GET | /campaigns | Index | Auth only | List user's campaigns |
5252
| GET | /campaigns/new | NewForm | Auth only | Create campaign form |
5353
| POST | /campaigns | Create | Auth only | Create campaign |
54-
| GET | /campaigns/:id | Show | Player | Campaign dashboard |
54+
| GET | /campaigns/:id | Show | Player | Campaign page (public dashboard) |
55+
| GET | /campaigns/:id/dashboard | OwnerDashboard | Owner | Owner-only management dashboard |
5556
| GET | /campaigns/:id/edit | EditForm | Owner | Edit form |
5657
| PUT | /campaigns/:id | Update | Owner | Update campaign |
5758
| DELETE | /campaigns/:id | Delete | Owner | Delete campaign |
@@ -65,6 +66,9 @@ Plugin (Core -- always enabled)
6566
| GET | /campaigns/:id/accept-transfer | AcceptTransfer | Auth only | Accept (token) |
6667
| POST | /campaigns/:id/cancel-transfer | CancelTransfer | Owner | Cancel transfer |
6768
| GET | /campaigns/:id/customize | Customize | Owner | Customization Hub |
69+
| GET | /campaigns/:id/owner-dashboard-layout | GetOwnerDashboardLayout | Owner | Get owner dashboard layout JSON |
70+
| PUT | /campaigns/:id/owner-dashboard-layout | UpdateOwnerDashboardLayout | Owner | Save owner dashboard layout |
71+
| DELETE | /campaigns/:id/owner-dashboard-layout | ResetOwnerDashboardLayout | Owner | Reset owner dashboard to defaults |
6872
| GET | /campaigns/:id/plugins | PluginHub | Player | Features page |
6973
| GET | /campaigns/:id/sidebar-config | GetSidebarConfig | Player | Get sidebar config |
7074
| PUT | /campaigns/:id/sidebar-config | UpdateSidebarConfig | Owner | Save sidebar order/visibility |
@@ -89,6 +93,15 @@ Plugin (Core -- always enabled)
8993
- **Accent color**: `accent_color` column — CSS `--color-accent` override injected via layout
9094
- Campaign settings page has image upload and color picker sections
9195

96+
## Two-Dashboard Architecture
97+
98+
Campaigns have two independently customizable dashboards:
99+
100+
- **Campaign Page** (`GET /campaigns/:id`) — visible to all members and public visitors. The "front page" of the campaign. Layout stored in `dashboard_layout` column.
101+
- **Owner Dashboard** (`GET /campaigns/:id/dashboard`) — visible only to campaign owner. Management-focused dashboard with quick links (Settings, Customize, Members, Plugins), category grid, and recent entities. Layout stored in `owner_dashboard_layout` column (migration 000006).
102+
103+
Both dashboards use the same `DashboardBlockSwitch` dispatcher and are editable via the Customization Hub (Dashboard tab shows both editors side-by-side). The dashboard editor widget mounts with different `data-endpoint` values pointing to the respective layout APIs.
104+
92105
## Dashboard Block Types
93106

94107
The campaigns plugin defines the central `DashboardBlockSwitch` dispatcher. Supported block types:

0 commit comments

Comments
 (0)