[Foundry] Live-push UX on WikiArticle & CampaignPlanning #154

Open
opened 2026-07-15 22:03:55 +00:00 by claude-bot · 0 comments
Contributor

Motivation/Context

#152 delivers the backend/adapter capability to place a token on the active scene; this issue delivers the GM-facing surface that makes it discoverable and safe to use during play, on the two pages where NPCs are read/managed today.

Approach

Add a GM-only "Send to Foundry" split-button:

  • On webapp/frontend/src/pages/WikiArticle.jsx for npc/creature entries, next to the #130 "Generate stat block" button.
  • On webapp/frontend/src/pages/CampaignPlanning.jsx NPC listings.

Default action is "Send to live scene" (#152's target=active_scene) when the campaign's current session is SessionStatus.in_progress (app/models/session.py:60, auto-transitioned by Celery Beat in reminder_tasks.py:1154–1196 when confirmed_time/end_time pass — Quest Board already knows server-side when a session is live) and the connection health check (#6) passes. Otherwise the button falls back to "Send to actor directory" (#9's existing target=directory behavior).

Per #24's hide-don't-disable rule: the button is hidden entirely (not shown-but-disabled) when the campaign's adapter returns None for npc_to_actor.

Pre-flight: reuse #6's health check on page load to decide whether the button should present itself in "live" mode, so the GM isn't surprised mid-scene by a push that silently falls back to the directory.

Feedback: queued/pushed/failed toast states matching #152's status contract, with the "no Foundry client connected" case rendered as an explicit, actionable message ("Open your Foundry world and try again").

Dependencies

  • Hard dependency: #152 ("Send to live scene" backend/API) — this issue is purely the UI layer on top of it.
  • Depends on #6 (health check) for the pre-flight live/directory decision.
  • Depends on #9's existing directory-push UI as the fallback path and general button pattern to extend.

Out of scope

  • Any new backend push logic — this issue only wires the UI to APIs delivered by #9 and #152.
  • Non-GM-visible surfaces (this feature is GM-only throughout).
  • Scene/token selection controls (v1 has none, per #152).

Acceptance criteria

  • GM-only split-button present on both WikiArticle.jsx (npc/creature entries) and CampaignPlanning.jsx NPC listings.
  • Button defaults to "Send to live scene" when session is in_progress and health check passes; falls back to "Send to actor directory" otherwise.
  • Button is hidden (not disabled) when the adapter doesn't support npc_to_actor.
  • Queued/pushed/failed toasts render, including the specific "no Foundry client connected" message.
  • Verified in the running app against a real Foundry test instance during an in_progress session.
## Motivation/Context #152 delivers the backend/adapter capability to place a token on the active scene; this issue delivers the GM-facing surface that makes it discoverable and safe to use during play, on the two pages where NPCs are read/managed today. ## Approach Add a GM-only **"Send to Foundry"** split-button: - On `webapp/frontend/src/pages/WikiArticle.jsx` for npc/creature entries, next to the #130 "Generate stat block" button. - On `webapp/frontend/src/pages/CampaignPlanning.jsx` NPC listings. Default action is **"Send to live scene"** (#152's `target=active_scene`) when the campaign's current session is `SessionStatus.in_progress` (`app/models/session.py:60`, auto-transitioned by Celery Beat in `reminder_tasks.py:1154–1196` when `confirmed_time`/`end_time` pass — Quest Board already knows server-side when a session is live) **and** the connection health check (#6) passes. Otherwise the button falls back to **"Send to actor directory"** (#9's existing `target=directory` behavior). Per #24's hide-don't-disable rule: the button is hidden entirely (not shown-but-disabled) when the campaign's adapter returns `None` for `npc_to_actor`. Pre-flight: reuse #6's health check on page load to decide whether the button should present itself in "live" mode, so the GM isn't surprised mid-scene by a push that silently falls back to the directory. Feedback: queued/pushed/failed toast states matching #152's status contract, with the "no Foundry client connected" case rendered as an explicit, actionable message ("Open your Foundry world and try again"). ## Dependencies - Hard dependency: #152 ("Send to live scene" backend/API) — this issue is purely the UI layer on top of it. - Depends on #6 (health check) for the pre-flight live/directory decision. - Depends on #9's existing directory-push UI as the fallback path and general button pattern to extend. ## Out of scope - Any new backend push logic — this issue only wires the UI to APIs delivered by #9 and #152. - Non-GM-visible surfaces (this feature is GM-only throughout). - Scene/token selection controls (v1 has none, per #152). ## Acceptance criteria - GM-only split-button present on both `WikiArticle.jsx` (npc/creature entries) and `CampaignPlanning.jsx` NPC listings. - Button defaults to "Send to live scene" when session is `in_progress` and health check passes; falls back to "Send to actor directory" otherwise. - Button is hidden (not disabled) when the adapter doesn't support `npc_to_actor`. - Queued/pushed/failed toasts render, including the specific "no Foundry client connected" message. - Verified in the running app against a real Foundry test instance during an `in_progress` session.
claude-bot changed title from [Foundry] Live-push UX on WikiArticle & CampaignPlanning to [Foundry] Live-push UX on WikiArticle & CampaignPlanning 2026-07-15 22:03:59 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rbrooks/Quest-Board#154
No description provided.