FE Lab — EOS Log Out + Discord Unlink Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Close the FE UX lab gaps so Online Character Select can Log out of EOS (shared-machine / next player), Discord Social can Unlink without inventing a second identity, and copy states that EOS Log Out is the account switch.
Architecture: EOS PUID remains the only Online identity. Discord is an external credential + invite delivery rail (LinkAccount / Connect). Log out of EOS clears device persist and Discord consent and returns to main so the next Online run shows Screen A. Unlink Discord drops delivery/link on the live PUID but keeps the EOS session and Online pool. Lab mock in tfa_gdd_html mirrors FE/FS locks; no real EOS/Discord SDK calls.
Tech Stack: FE lab HTML (tfa_gdd_html/index.html), tfa_gdd_html/js/frontend.js, FE UI/UX Spec markdown, optional GDD front-end chapter blurb.
Global Constraints
Section titled “Global Constraints”- Pack root only:
E:\Cursor_Terra\programming bible\ - Do not invent Discord-as-Friends, Discord chat, or a Discord-only account switch that keeps Stay signed in
- Never persist Discord AccessToken (lab already clears
discordLinkedon EOS Log Out) - Lab checkbox label for two-factor stays 2-FA (not “TFA” for Terra Firma)
- Graphify update after code edits
File map
Section titled “File map”| File | Responsibility |
|---|---|
tfa_gdd_html/index.html |
Character Select Log Out button; coach copy |
tfa_gdd_html/js/frontend.js |
Shared logout + confirm; show/hide Log Out on Online chars; Discord Unlink handler |
Terra_Firma_FrontEnd_UI_UX_Spec.md |
Lock: Unlink ≠ account switch; Character Select Log Out already required — reinforce |
tfa_gdd_html/chapters/front-end-ui.html |
One-line lab/product parity note if needed |
Task 1: Formalize product rules in FE Spec
Section titled “Task 1: Formalize product rules in FE Spec”Files:
-
Modify:
Terra_Firma_FrontEnd_UI_UX_Spec.md -
Under §6 / Stay signed in (or §7 Character select): state Online Character Select shows Log out of EOS (same clear as Esc).
-
Under Social Discord pane: Unlink Discord drops Connect link / delivery on this PUID; does not switch whose EOS account owns the device. Shared-PC next player = Log out of EOS.
-
Confirm: “Confirm on Log Out (drops session / persist).”
Task 2: Character Select — Log out of EOS (lab)
Section titled “Task 2: Character Select — Log out of EOS (lab)”Files:
-
Modify:
tfa_gdd_html/index.html -
Modify:
tfa_gdd_html/js/frontend.js -
Add
#fe-logout-chars(ghost) on Character Select row; Online only (hidden on Solo). -
Extract
logoutEos()used by Esc#fe-logoutand#fe-logout-chars. -
confirm(...)before clear: Stay signed in + Discord consent; thenloggedIn/persist/discordLinked/usercleared →show("main"). -
renderChars()toggles visibility fromstate.pool === "online" && state.loggedIn.
Acceptance: Online → chars → Log out → main → Online → EOS Screen A (no silent persist).
Task 3: Discord Unlink (lab Social pane)
Section titled “Task 3: Discord Unlink (lab Social pane)”Files:
-
Modify:
tfa_gdd_html/js/frontend.js -
When
discordLinked, show Unlink Discord (data-discord-unlink). -
Fine print: Unlink ≠ account switch; use Log out of EOS for another player on this device.
-
Handler sets
discordLinked = false, note, re-render; stay on Social / world overlay.
Acceptance: Link → Unlink → Link again; Unlink does not wipe Online characters or jump to main.
Task 4: Coach + Esc confirm parity
Section titled “Task 4: Coach + Esc confirm parity”Files:
-
Modify:
tfa_gdd_html/index.html(coach) -
Modify:
tfa_gdd_html/js/frontend.js(Esc logout uses samelogoutEos()) -
Coach: shared-PC rule in one line (Log out of EOS clears Discord consent on this device).
-
Esc Log out uses the same confirm + clear path as Character Select.
Task 5: GDD front-end chapter touch (light)
Section titled “Task 5: GDD front-end chapter touch (light)”Files:
-
Modify:
tfa_gdd_html/chapters/front-end-ui.html(and sync reader source of truth ifgdd-content.jsowns the HTML blob) -
Note Log Out on Online Character Select + Esc; Discord Unlink is not account switch.
Task 6: Verify + graphify
Section titled “Task 6: Verify + graphify”- Manual walk: Solo chars has no Log Out; Online has it; Esc confirm; Discord unlink. (logic wired; spot-check in FE lab)
-
graphify update .from pack root.
Out of scope
Section titled “Out of scope”- Real EOS / Discord SDK
- Website SSO logout inside the game lab
- Redesigning FE31/FE32/FE33/FE4 art plates (captions note legacy Discord-on-A art; redraw later if ordered)
- Removing 2-FA lab checkbox (label clarified instead)
Follow-up (2026-11-08) — Discord Link after login
Section titled “Follow-up (2026-11-08) — Discord Link after login”- Lab Screen A: remove Continue with Discord; fine print points to Social → Discord Link
- Lab 2-FA checkbox label:
2-FA (Lab: Purpose to show UX) - FE Spec + FS-ID: cold Online = username/password; Discord = post-login LinkAccount only
- Rebuild
tfa_fs_html/fs-chapter.jsfrom FS markdown
Follow-up — Discord OAuth token flow (not password)
Section titled “Follow-up — Discord OAuth token flow (not password)”- Lab: Social → Link Discord → Open Discord → Authorize → AccessToken → LinkAccount → profile card
- No Discord email/password fields inside Terra Firma
- FE Spec Discord pane /
W_TFA_DiscordOAuthwording matches token consent path