1
0
Fork 0
Commit graph

1293 commits

Author SHA1 Message Date
a5f2959b27 v0.16.5 - add attendance unlock timeline, list thresholds in Discord roll call 2026-11-21 02:35:47 -05:00
c595781790 docs: add v0.16.5 changelog entry 2026-11-21 02:35:33 -05:00
4022e5b5f1 feat(intelligence): add attendance-gated feature unlocks to mission pages
Missions gain an attendanceUnlocks tier list (admin tab plus side-op dialog),
rendered as a timeline under the attendance card: reached tiers light up in
their accent, unreached tiers stay muted with an X TO GO tag.

- shared derivation, validation and side-op parser in lib/intelligence
- thresholds sorted on save, duplicates rejected, above-max allowed
- one compact field in the Discord roll-call; attendance hash now includes
  tiers, embed schema version 4
- int tests and an e2e render check at two attendance levels
2026-11-21 02:30:48 -05:00
429d2028d0 v0.16.4 - add unlimited arsenal stock, fix the claimed op notice 2026-11-20 20:14:55 -05:00
86b1c9ae61 docs: add v0.16.4 changelog entry 2026-11-20 20:13:18 -05:00
b90247a288 fix(bot): rewrite the Friday notice in the claimed state
The claim path appended a credit line to the invitation, so a claimed notice
still said the slot was open, that nobody had picked it up, and that Jason
would host if nobody did.

- renderClaimedNotice(): the whole body for the claimed state, role ping
  dropped since there is nothing left to ask for
- compare the live message against the rendered body each poll, so a message
  left contradictory by an older build heals on the next tick
- a cancelled claim still restores the full invitation, ping included
- cover both bodies and the claim parser in the notice integration test
2026-11-20 20:11:53 -05:00
5418d6563e feat(lockers): seed and unlimited-stock sync for limited arsenal 2026-11-20 19:52:15 -05:00
716c87bb87 v0.16.3 - fix relation meters, rating prompts, op notice date 2026-11-20 18:01:20 -05:00
56b53f207d docs: add v0.16.3 changelog entry 2026-11-20 17:27:13 -05:00
4fba0b03c7 fix(bot): show the Friday op slot date in Eastern time
Discord renders <t:epoch:D> in each viewer's timezone, so the slot's Friday
00:00 Eastern epoch read as Thursday for members west of Eastern. Render the
date as a pinned Eastern label instead.

- add fridayDateLabel(): the upcoming Friday in America/New_York
- noticeToken() now returns that label, keeping dedup stable per Friday
- legacyNoticeToken() still matches older <t:epoch:D> notices and the service
  rewrites them in place, so a deploy does not duplicate or leave one behind
- only match the bot's own messages, since a plain-date token could otherwise
  hit a member's message (which the bot cannot edit)
- document the timezone rule in the bot AGENTS.md
2026-11-20 17:25:04 -05:00
9288d1498e refactor(intelligence): reword missing rating blurbs, replace "self rating" text with Alert, improve layout on campaign card 2026-11-20 16:37:12 -05:00
7428efe6aa fix(intelligence): grow negative relation meters left of zero
The two meters on a faction dossier shared a centered track, but a negative
score grew to the right and a positive one to the left, so the side a bar sat
on said the opposite of what it meant. Negative now extends left of the zero
line and positive right.

The labels also read badly side by side: "They see us" and "We see them" each
start with the party being looked at, which invites reading them the wrong way
round. "How they see us" and "How we see them" name the direction first.
2026-11-20 03:03:29 -05:00
fc6fec4a45 v0.16.2 - add faction relations graph view 2026-11-18 16:41:11 -05:00
2501c63481 docs: add v0.16.2 changelog entry 2026-11-18 16:40:30 -05:00
392717bedc feat(intelligence): add a radial graph view to the faction relations page
The matrix answers "what is this faction's score", not "who is tied to whom".
Add a graph view behind a Matrix/Graph switch on the same page.

The player faction sits at the center and every other faction is placed on a
ring by classification (majors innermost, then minors, corporations, specials),
so its relations read as spokes and the rest as chords. Positions are
deterministic: rings ordered by type, members by name, starting at twelve
o'clock, with faint guide rings so the structure is legible without hovering.

Relations are straight lines. A relationship runs both ways, so where both
sides have an opinion the two directions are drawn side by side on either side
of the axis, each spanning the full distance between the factions, colored and
weighted by its own score, with an arrowhead at the faction being regarded. The
two directions differ independently: a faction can be resented by one that it
regards neutrally. A pair with only one opinion keeps a single centered line.

A line that would cut through an unrelated faction steps aside just far enough
to clear it, and only for factions actually alongside the line rather than
beyond either end. Straight stays straight.

Hovering a faction isolates its web and opens a panel listing what it regards
and who regards it; clicking opens the dossier. Pan, wheel zoom and reset are
local, and the whole view is hand-drawn SVG, so no graph library was added.

The layout is pure and unit-tested: input order cannot move a node, the two
directions of a pair run parallel rather than overlapping, single-direction
pairs span the whole pair, and a blocked line dodges instead of crossing a node.
2026-11-18 16:34:50 -05:00
fa87678408 v0.16.1 - replace the wiki body editor, fix caret alignment 2026-11-18 15:17:01 -05:00
21c6b30431 docs: add v0.16.1 changelog entry 2026-11-18 15:16:25 -05:00
5e1f200261 feat(wiki): replace textarea overlay with a CodeMirror markdown editor
The body editor painted highlighted markdown in a div behind a transparent-text
textarea, so the painted text and the caret were two different layout engines.
Any wrap-point difference (borders, scrollbar gutters, engine rounding, trailing
newlines) shifted the overlay by whole lines once content soft-wrapped, making
clicks land on the wrong glyph and the document end feel unreachable. The CSS
patch that preceded this reduced the drift but could not remove the class of bug.

CodeMirror 6 owns text and caret together, so the failure mode is gone by
construction rather than by maintenance. The body remains a markdown string, so
prepareMarkdown, ::: directives, wikilinks, templates, revisions and the preview
pipeline are untouched, with no data migration.

- WikiMarkdownEditor: EditorView lifecycle, theme and markdown HighlightStyle
  bound to the app's CSS tokens, history, line wrapping, IME-safe keymap.
- markdownCommands: one pure command table shared by toolbar buttons and keys.
- editorChange: toolbar updates dispatch only the differing span, keeping undo
  granular and selections outside the edit intact.
- Removes WikiEditorHighlightLayer, editorMetrics, lib/wiki/editorHighlight,
  useEditorHistory and the now-dead textarea selection reader.
- Adds e2e proof: glyph-precise clicks across wrapped paragraphs, list items,
  image markdown and scrolled documents land at the exact clicked offset.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-11-18 15:12:22 -05:00
de60e5d3e0 v0.16.0 - add faction relations ledger and relations overview, fix rich text and wiki editor rendering 2026-11-18 14:15:00 -05:00
b3bf5c8a46 docs: add v0.16.0 changelog entry 2026-11-18 14:14:31 -05:00
9e6cd55fe6 refactor(intelligence): drop the factions.relationships array in favour of the ledger
Nothing stores a pairwise score on a faction any more, so remove the array
field, its admin UI and the masking line that blanked it for undiscovered
factions. The disposal-mask doc comment now points at the ledger, which
applies the same rule by filtering entries that name an undiscovered faction.

The second migration converts every non-zero legacy value into an
opening-balance entry (custom delta, dated at the owning faction's last update
so it does not read as a fresh event, legacy note preserved) and then drops
the table. Zero rows are skipped because a stored 0 and no entries mean the
same thing.

Two integration specs that created or asserted `relationships` now use the
ledger instead.
2026-11-18 14:13:29 -05:00
cb06ba79c0 feat(intelligence): show derived faction relations on the faction and relations pages
The faction dossier's Relationships block only ever showed one direction, and
only the directions someone had bothered to type by hand.

Read both directions from the ledger instead: each row now carries "they see
us" and "we see them" meters, and a Recent Developments list under them spells
out the events behind those numbers in plain language. Hidden entries move the
meters without appearing in that list.

Add /intelligence/factions/relations, a full cross-table of every faction
against every other, player faction first, with the existing band labels as a
legend. Rows and headers link back to dossiers, and the table scrolls sideways
rather than truncating scores. A Relations entry in the Intelligence sidebar
points at it.
2026-11-18 14:13:20 -05:00
2384c7f5a4 feat(intelligence): add the faction relation ledger collection and score math
Pairwise faction attitudes were hand-typed into a per-faction array, so the
two directions of one relationship lived in different documents and could
disagree with each other.

Add `faction-relation-entries`: one row per event that moved one faction's
attitude toward another, with the score computed on read instead of stored.
Entries are directed by default with a mutual flag for shared events; severity
tiers set the delta with a custom override; decaying entries halve per
half-life (new GameRules knob, 30 days default) while lasting shifts never
fade; voiding retires an entry with a stamped reason instead of deleting it;
hidden entries still move the score but never explain it to players.

`factionRelations.ts` holds the pure math (severity presets, decay, directed
and mutual scores, bands), and `factionRelationLedger.ts` is the single read
path so the voided, hidden and undiscovered-faction rules exist in one place.
Reads run as the caller, never with `overrideAccess`; GM notes are gated by
field read access, and hidden rows are censored by an `afterRead` hook.

Includes the permission group, the `admin:faction-relation-entries:manage`
page gate, the integration spec, and the migration that creates the table and
its enums.
2026-11-18 14:13:20 -05:00
e15b0923ad fix(wiki): align highlight overlay and textarea wrapping so caret/click match painted text
The markdown overlay shared the wrapper's inset-0 box with the transparent-text
textarea, but its inner div added a 1px transparent border while the textarea is
border-0, shrinking its text width by ~2px; Firefox/Safari classic scrollbars
reserve another ~15px inside the scrolled textarea that the overflow-hidden
overlay never sees. Either gutter makes long unbreakable tokens (e.g. image
markdown URLs) wrap differently between the two layers, so the overlay text
drifts vertically under the caret/click math and editing feels like it's one or
more lines off right after inserting an image.

Compose both layers' classes from a shared WIKI_EDITOR_METRICS constant, drop
the overlay border, hide the textarea scrollbar so its content width matches the
overlay in every browser, and lock class parity with a jsdom RTL spec.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-11-18 13:56:10 -05:00
34c0d5681f fix(rich-text): render full lexical formatting incl. colours across all fields
RichText authored in the admin panel was rendered as plain text on the
public site: headings/lists/quotes were flattened by Tailwind preflight
(no @tailwindcss/typography installed), and Payload's default JSX
converter ignored text colours.

- src/lib/lexical: shared editor factory (ptfLexicalEditor) + shared
  colour palette (textState) + colour converter (richTextConverters)
- RichTextView: canonical .lexical-content renderer (colour-aware),
  swapped into every frontend render site
- All rich-text editors route through the factory, so every field
  inherits the coloured editor (incl. the previously-unedited ones)
- .lexical-content CSS extended with checklist/table/heading rules,
  wrapped in @layer components so per-page utilities still override;
  dropped the now-dead per-page prose hacks
- Remove the now-dead briefingConverters in favour of the shared
  converter; add tests/int/rich-text-view.int.spec.ts
2026-11-18 13:10:26 -05:00
1bb5cdde60 v0.15.3 - add private wiki drafts, one-way publish 2026-11-18 11:18:05 -05:00
60f85e240d docs: add v0.15.3 changelog entry 2026-11-18 11:07:31 -05:00
b5f48de0b9 feat(wiki): add private drafts with a one-way publish
Wiki pages gain a Draft flag pinned to their original creator. A draft is
visible only to its creator, wiki moderators and admins: the collection's
read access returns a where clause so the REST/local API filters drafts,
and every frontend query ANDs the same clause (they run with overrideAccess).

Publishing is one-way. A page whose stored draft is false is rejected (403)
when sent draft: true, both in the service and in access.update.

UI: amber DraftBanner on the detail page, a Draft chip in WikiRow, and a
Draft switch in the editor that disables once the page is published.
2026-11-18 11:06:37 -05:00
def32f2c82 v0.15.2 - add undiscovered factions, draft NPC dialogue in the editor 2026-11-18 09:34:46 -05:00
7c92ffaa1a docs: add v0.15.2 changelog entry 2026-11-18 09:33:58 -05:00
1d45c3fee1 feat(intelligence): add undiscovered faction state with read masking
Factions gain a discovered checkbox plus a read-time mask so players see
the entry (UNDISCOVERED card, classified detail stub) without its name,
description, standing, relationships, campaigns or cover image.

The mask runs in the Factions afterRead hook, so every reader path is
covered: pages, REST, and populated relationships. Readers holding the new
factions:view-undiscovered permission or system:admin-access see the real
record; admin panel reads are exempt so a masked edit form can never write
the placeholder name back over a record.
2026-11-18 09:19:57 -05:00
4264431e4d feat(npc-dialogue): AI-assisted conversation drafting behind the review gate
Add a Generate button to the flow editor that drafts a whole conversation
from a form brief, and per-line Rewrite/Shorten/Sharpen controls in the node
dialog. Both land in unsaved field state, so a draft only reaches players when
an author saves the document: neither server action writes to npc-dialogues.

- src/lib/ai/generate.ts: extract the Unsloth client out of payload.config so
  Compose and dialogue drafting share one path; add generateStructured and
  resolveModel, with an optional UNSLOTH_MODEL_STRUCTURED override
- generationSchema.ts (pure): strict-safe JSON schema, normalizer with
  breadth layout, validator that rejects unknown flag keys, unauthorised
  effects, dangling hops and missing keys
- generation.ts: context loading, one validate-and-retry, then give up rather
  than hand back a broken graph; dash normalization keeps shipped copy clean
- effect vocabulary limited to notify and flag; emit, reward and discord stay
  author-only
- provenance group on npc-dialogues (migration 20261112_171955) records model,
  prompt version, attempts and the brief the draft was accepted from
- tests: 21 cases covering the normalizer, validator, retry paths and the
  rewrite parser, with the model call injected
- docs/npc-dialogue-ai.md and src/lib/npc-dialogue/AGENTS.md
2026-11-12 12:26:35 -05:00
9f192a8159 v0.15.1 - fix Discord bot crash on stale interactions 2026-11-03 12:51:35 -05:00
8108465354 docs: add v0.15.1 changelog entry 2026-11-03 12:50:36 -05:00
6ee32f5085 docs(bot): record the interaction ack and error-path rules 2026-11-03 12:50:29 -05:00
c4cbe43c4f fix(bot): survive a stale Discord interaction instead of crashing
A manual /rollcall took the bot down: the command fetched the guild member
and ran the staff check before acknowledging, missed Discord's 3 second ack
window, then died on "Unknown interaction" when it tried to defer (and again
when the error path tried to reply). discord.js re-emits a rejected event
listener on the client as an 'error' event, and with no handler attached Node
threw and exited the process.

Ack first, protect the error paths:
- /rollcall, /remind-evaluations and /debug defer immediately and report
  permission denials through editReply.
- safeEphemeralReply (bot/lib/interactions.ts) never rethrows, and the RSVP
  and transfer handlers use the same guarded behaviour.
- client.on(Events.Error) logs instead of exiting. The entrypoint restarts a
  dead bot after 5 seconds, so the previous symptom was a silent gap.
2026-11-03 12:50:29 -05:00
8fff9c3f92 v0.15.0 - style mission detail as dossier cards, add command chain editor, faction links 2026-11-02 16:13:47 -05:00
da601dcc8a docs: add v0.15.0 changelog entry 2026-11-02 16:13:47 -05:00
9aa6a5c0ef chore(frontend): move command-chain chevron into a full-width centered rule
Replace the header chevron button with a full-width rule and a
centered toggle between the description and the player list.
2026-11-02 15:42:09 -05:00
c0538f902c feat(frontend): style mission-detail sidebar cards as dossier frames
Convert the Campaign, Roster, and Server sidebar cards from Item
variant=outline to the TacticalFrame primitive (squared corners, grid
texture, corner brackets, classification strip with REF code). The
campaign body content is the link; the status badge moves onto the
title row with a hover-reveal chevron, matching the Roster rows.
2026-11-02 15:42:09 -05:00
3ac6ebd87d feat(frontend): make the command-chain editor a collapsible panel
Wrap the mission command-chain editor content in a Collapsible with an
expand/collapse trigger in the header row, next to the Override/Legacy/
Defaults badge. The 'Command chain' title folds into the trigger so the
card header holds only the toggle and the status badge.
2026-11-02 14:28:55 -05:00
b6e8fa6f90 feat(frontend): make faction cards links with type-tag width and cover-image backgrounds
Each faction card in the Mission Details FACTIONS section is now an anchor
to /intelligence/factions/<id>. The type badge (Player/Major/Minor/
Corporation/Special) uses width:fit-content so its colored background only
spans the text instead of the full card, and a faction's coverImage (when
present) renders as a centered object-cover background at low opacity that
brightens on hover.
2026-11-02 14:28:53 -05:00
e5f6d107b9 feat(frontend): drop redundant internal section titles from mission detail cards
The TacticalFrame header (icon + 'OPERATION // Topic') now owns each
card's heading; the duplicate per-component content titles are removed
across Rating, Mission Details, Briefing (SQF export retained),
Objectives, Factions, Roles (Max Players stat retained), Comms,
Logistics, and Role Sign-Ups (queue note retained). The Command Chain
title removal is left in the working tree, on top of the separate
collapsible-panel work-in-progress in MissionCommandChainEditor.tsx.

Cleans up the now-unused ClipboardListIcon import and a dangling
aria-labelledby reference left by the removed Rating heading.
2026-11-02 13:35:40 -05:00
e070d2b586 feat(frontend): restore frame section titles and color-code faction types
TacticalFrame classification labels are back on all 11 mission-detail
frames (the earlier label-less pass is reverted). Faction type is now
rendered as a friendly, type-colored tag (Player/Major/Minor/Corporation/
Special) instead of the raw database value.
2026-11-02 13:23:53 -05:00
9db57a465c fix(frontend): remove doubled corner chrome from threat assessment card
The card rendered its own border, grid texture and corner brackets on top
of the TacticalFrame's, so its bottom brackets coincided with the frame's
and read as a heavier, doubled corner. Both the empty-state and populated
branches now drop that redundant chrome and let the frame own the border,
brackets and texture.
2026-11-02 13:06:30 -05:00
d279720376 feat(frontend): drop duplicate frame labels from mission detail cards
TacticalFrame takes an optional 'classification' prop, rendered in the
strip only when provided. All 11 mission-detail frames now omit it, so
the uniform 'OPERATION // <Topic>' label is gone and each card's own
content title owns the heading (Mission Rating, Mission Details,
Briefing, Communications, and so on). The lead icon and REF code stay.
2026-11-02 13:06:27 -05:00
f2f637e289 feat(frontend): render threat assessment empty state and drop redundant internal header
When no analyst estimate exists, the card now shows an inline
'Threat assessment unavailable / insufficient intel' placeholder that
matches the card chrome instead of collapsing to nothing. The duplicate
internal 'Threat Assessment // Intel' strip is removed now that the
section header carries the icon and label; the unused refCode is dropped
with it.
2026-11-02 12:20:11 -05:00
0a8246ebcc feat(frontend): add lead icons to mission detail section headers
TacticalFrame takes an optional 'icon' prop rendered before the
classification label in the strip. Each of the 11 headers now passes an
icon, reused from its section's existing component icon for coherence:
RATING star, DETAILS clipboard, THREAT radar, BRIEFING doc,
OBJECTIVES crosshair, FACTIONS shield, ROLES users, COMMAND branch,
SIGN-UPS user-plus, LOGISTICS truck, COMMS radio.
2026-11-02 12:20:04 -05:00
bb7d7337ed chore(intelligence): standardize mission detail section labels and gutters
Standardize every TacticalFrame section header on the mission detail page to
"OPERATION // <Topic>" (was RATING // THREAT, OBJECTIVES, FACTIONS // INVOLVED,
ROLES // MANNING, etc.) so each card shares a uniform dossier label.

Add a consistent px-4 py-4 min-w-0 gutter to the six content-block sections
(briefing, objectives, factions, roles, comms, logistics) plus Mission Rating,
so their content no longer sits flush against the card borders. The already
bordered cards (Mission Details, Threat Assessment, Command Chain, Sign-Ups)
are left untouched.
2026-11-02 12:03:45 -05:00
7380131510 feat(frontend): style mission details sections as dossier cards
Wrap each main-content section of the mission details page in a
TacticalFrame card (classification strip, corner brackets, grid
texture, readout footer) following the tactical dossier recipe.
Add a `grow` prop to TacticalFrame for content-height frames.
The hero header is left untouched.
2026-11-02 11:14:43 -05:00