Commit Graph
100 Commits
Author SHA1 Message Date
hypercross aa326f38a0 refactor: introduce RevealManager and Article DOM context
Decouple the reveal logic from the `Article` component by introducing
a `RevealManager` component and an `ArticleDomCtx`. This allows the
reveal logic to reactively manage DOM injections and classes without
polluting the `Article` component's props or lifecycle.

Additionally, implements a robust `cleanupInjections` mechanism to
ensure that injected buttons and styling artifacts are properly removed
during navigation, role changes, or disconnections.
2026-07-07 22:19:04 +08:00
hypercross 1ef2560faa fix: normalize line endings in frontmatter parsing
Normalize CRLF line endings to LF before parsing frontmatter
to ensure regex matching works consistently across different platforms.
2026-07-07 21:47:25 +08:00
hypercross 6b3a915350 refactor: simplify spark button injection logic
Update the spark button injection to use `data-spark` slugs on
`md-table` elements instead of manual table parsing. This improves
reliability by leveraging the slug generated during markdown
rendering.
2026-07-07 21:44:00 +08:00
hypercross 56af7dea42 feat: add spark table roll buttons for GMs
Introduces the ability for GMs to inject spark roll buttons into
tables that match existing spark completions.

- Replaces `linkPrefill` with a more flexible `actionPrefill` system
  to support multiple command types (e.g., `/link`, `/spark`).
- Implements `injectSparkButtons` to identify spark tables in the
  DOM and insert action buttons.
- Updates `JournalInput` to handle structured prefill actions.
2026-07-07 21:38:43 +08:00
hypercross e801ac9b5f refactor: improve spark table lookup and error reporting
Replace the heuristic-based slug parsing with a more robust
combined-slug lookup to correctly handle page names containing
hyphens. Added `scanSparkTables` to provide better error messages
when a table is not found.
2026-07-07 19:13:11 +08:00
hypercross 9a312f76ad fix(completions): instantiate Slugger per file
Move Slugger instantiation inside the file loops to prevent
state leakage between files, as Slugger is stateful.
2026-07-07 19:07:37 +08:00
hypercross 97148aa010 refactor: improve column slug extraction logic 2026-07-07 19:05:47 +08:00
hypercross 2f29f8774d feat: add spark table completion and rolling support
Implement "spark tables" functionality, which allows users to roll
dice against markdown tables to retrieve specific values.

- Add `sparkTablesSource` to scan markdown files for tables starting
  with a dice notation (e.g., d6, d20).
- Implement `/spark` command in the journal to resolve and roll
  spark tables.
- Add a new message type `spark` with a dedicated UI component to
  render the results.
- Update completions API to include spark table metadata.
2026-07-07 19:02:17 +08:00
hypercross 3690d13407 refactor: extract persistence and reveal logic into new stores
Move localStorage and URL parameter management from `journalStream`
to a dedicated `persistence` store. Relocate DOM reveal and heading
injection logic to a new `reveal` store to improve separation of
concerns.
2026-07-07 18:10:43 +08:00
hypercross ef7295ff7a fix(sidebar): add correct node identity to heading set 2026-07-07 13:26:35 +08:00
hypercross 574d17f201 refactor: improve heading revelation logic
Rewrite `addRevealedClasses` to use a two-pass approach that correctly
cascades revealed status from child headings to parent headings. This
ensures that if a sub-heading is revealed, its parent headings are
also treated as revealed, maintaining proper visibility hierarchy.
2026-07-07 12:56:28 +08:00
hypercross ced9a4f8f2 feat: implement content reveal mechanism via DOM traversal
Add `addRevealedClasses` to apply `revealed` or `concealed` CSS classes
to article elements based on the current heading hierarchy and
revealed paths. Update `Article` to expose its DOM element via an
`onDom` callback.
2026-07-07 10:56:19 +08:00
hypercross adf28a7cf1 feat: implement visibility logic for sidebar nodes
Add support for hiding file tree nodes and headings based on path
revelation status. This allows the sidebar to dynamically show only
the relevant parts of the file structure and table of contents.
2026-07-07 09:27:04 +08:00
hypercross c5e1167beb feat: implement granular section visibility control
Introduce the ability to reveal specific sections of a document
rather than entire files. This includes:

- Updating `revealedPaths` to map normalized file paths to sets of
  revealed section slugs.
- Adding `isPathRevealed` to handle visibility logic for connected
  clients and GMs.
- Enhancing `extractHeadings` to calculate `startLine` and `endLine`
  for each TOC node to support precise section identification.
2026-07-07 07:44:57 +08:00
hypercross 7cfc0fd4f3 feat: add player invitation and autojoin functionality
Implement a system to invite players via generated URLs that
automatically configure their name and role.

- Add `InviteDialog` to allow users to generate and copy invite links
- Implement autojoin logic in `ConnectDialog` based on URL parameters
- Add an "+ invite" button to the `JournalPanel` player list
- Ensure `autojoin` parameter is stripped on disconnect to allow
  manual connection later
2026-07-06 18:41:40 +08:00
hypercross 1d0f2f7c3e feat: add plain text dice roll detail
Introduces `plainDetail` to the dice engine to provide a non-HTML
version of the roll results. This allows components to display
the roll breakdown without needing to parse or render HTML.
2026-07-06 18:18:16 +08:00
hypercross 0fc61e2f94 refactor: simplify journal message types and implement GM rolls
Refactor journal message types to use flatter, more intuitive names:
- `narrative` becomes `chat`
- `article.reveal` becomes `reveal`
- `roll.request`/`roll.result` becomes a single `roll` type

Implement client-side dice roll resolution for GMs. When a GM uses
the `/roll` command, the result is now calculated locally using
`resolveRollPayload` before being sent to the stream, rather than
requesting a roll from the server.
2026-07-06 18:06:32 +08:00
hypercross 59236f6dba feat: implement role-based access control
Introduce 'gm', 'player', and 'observer' roles to the journal system.
This includes:
- Restricting command usage and completions to the GM role.
- Implementing role-based message emission permissions.
- Adding a player list and role indicators in the UI.
- Persisting the user's role in localStorage.
- Updating the connection logic to include the role in the client ID.
2026-07-06 17:52:56 +08:00
hypercross e216b94e25 feat: move revert action to message cards and improve article links
- Move the revert functionality from the journal input to individual
  message cards for better UX.
- Implement `RevealLink` component for article reveals to allow
  navigation without losing URL parameters.
- Add helper functions to format article paths and slugs into
  human-readable titles.
2026-07-06 17:26:37 +08:00
hypercross 276241f3b0 feat(journal): improve command completion behavior
- Scroll the selected completion item into view
- Filter commands based on prefix when typing a slash command
- Keep completion menu open while typing a command
- Add data attributes to track completion indices for scrolling
2026-07-06 17:20:20 +08:00
hypercross e0d61cf91e feat: improve completions loading and UI handling
Refactor the completions system to support both CLI mode (via
`/__COMPLETIONS.json`) and a client-side fallback scan for dev mode.

- Implement client-side scanning of the file index for dice and headings
- Add `ensureCompletions` to allow components to await data readiness
- Update `JournalInput` to handle "no results" states in the dropdown
- Improve keyboard navigation (Tab to accept, Enter to select)
- Update dice regex to support `:md-dice[...]` syntax
2026-07-06 17:13:11 +08:00
hypercross 4c5add2414 feat(journal): implement JournalInput with command autocomplete 2026-07-06 16:57:36 +08:00
hypercross 8284f5caee feat: add completions API and scanning logic
Implement a new completions system that scans markdown files for
dice notation and headings. The server now exposes a
`/__COMPLETIONS.json`
endpoint and automatically recomputes the completion index when
files are added, updated, or deleted.
2026-07-06 16:50:45 +08:00
hypercross 307a3c8320 refactor: extract JournalHeader from JournalPanel
Extract the header logic into a standalone `JournalHeader` component.
This new component manages the connection status display, session
dropdown for switching between sessions, and the ability to create
new sessions or disconnect.
2026-07-06 16:22:06 +08:00
hypercross 13f454de9c feat: add URL parameter syncing for session and player
Implement URL search parameter synchronization for `session` and
`player`
to allow for bookmarkable links. Added `sessionName` to the journal
stream state to support displaying human-readable session names in the
UI. Improved layout transitions and updated the JournalPanel to show
more detailed connection information.
2026-07-06 16:16:01 +08:00
hypercross 6b5fcdc051 fix(cli): use async broker creation in journal server
Use `AedesFactory.createBroker()` instead of the constructor to ensure
persistence is properly initialized before handling connections.
2026-07-06 16:01:29 +08:00
hypercross 98c4a195e8 refactor: replace websocket-stream with native ws utility
Remove the `websocket-stream` dependency in favor of
`createWebSocketStream`
from the `ws` package. This simplifies the MQTT broker setup in the
journal server and removes unnecessary transitive dependencies.

Also improve the JournalPanel UI with smoother transitions and better
visibility handling.
2026-07-06 15:53:52 +08:00
hypercross 34d647d611 feat: implement websocket-stream for journal server
Integrate `websocket-stream` to handle MQTT broker upgrades in the
CLI and add granular connection status tracking to the UI.

- Add `websocket-stream` dependency
- Update CLI to use `websocket-stream` for socket upgrades
- Enhance `journalStream` store with `connectionStatus` and
  `connectionError` states
- Add visual connection status indicators to `App` and `JournalPanel`
2026-07-06 15:38:28 +08:00
hypercross 862ba9c01b feat: simplify journal connection via WebSocket upgrade
Refactor the journal server to run over WebSockets on the existing
HTTP server instead of a separate MQTT TCP port. This removes the need
for a separate port configuration and simplifies the connection flow
by auto-connecting to the current host.

- Remove `--mqtt-port` CLI option
- Attach Aedes broker to the HTTP server via WebSocket upgrade
- Update UI to remove manual broker URL and player name inputs
- Add "Content Source" access from the sidebar
- Update JournalPanel to auto-connect to the local server
2026-07-06 15:30:21 +08:00
hypercross 53c33587fb feat(journal): implement journal UI components
Introduce a complete set of journal components including:
- JournalPanel: main container with mobile/desktop support
- ConnectionBar: MQTT connection and session management
- StreamView and StreamMessage: message log and individual message cards
- ComposePanel: message composition with type selection
- DynamicForm: recursive form generator based on Zod schemas
2026-07-06 15:06:19 +08:00
hypercross 8194438816 feat(journal): implement message registry and stream store
Implement a robust journal system featuring a type-safe message
registry and an MQTT-backed stream store.

- Add `registry.ts` to manage message type definitions, Zod schemas,
  and custom reducers.
- Implement `journalStream.ts` to manage MQTT connections, session
  lifecycle, and reactive message state.
- Add built-in message types for `narrative`, `intent`, `roll`,
  and `article`.
- Provide utilities for message validation, optimistic local updates,
  and message reversion.
2026-07-06 14:48:18 +08:00
hypercross 21f8fbcd0b feat: add MQTT journal server for session persistence
Implement a journal server that uses an Aedes MQTT broker to
persist stream messages to JSONL files and manage session metadata
via a manifest.

- Add `aedes`, `mqtt`, and `zod` dependencies
- Implement `createJournalServer` in `src/cli/journal.ts`
- Integrate journal server into the `serve` command
- Add `--mqtt-port` option to the CLI
- Add session lifecycle management (create, update, delete) via
  retained MQTT topics
2026-07-06 14:19:16 +08:00
hypercross 08389601ac style: reformat and improve CSS structure
- Add Tailwind source scanning for color utilities
- Implement icon masking support
- Reformat CSS for better readability and consistency
- Expand utility definitions into multi-line blocks
2026-07-06 13:28:01 +08:00
hypercross 771fe6a112 style: add mask properties to icon class 2026-06-16 16:40:44 +08:00
hypercross 1582191655 feat: add custom YAML tag code block extension 2026-05-11 12:05:19 +08:00
hypercross a19d848456 refactor: remove words prop from md-emfont
Removes the `words` property from `EmfontProps` and simplifies the
URL construction by removing the font subsetting logic.
2026-05-11 11:56:22 +08:00
hypercross 4038d67ea0 feat: add md-emfont component and format code
- Add `md-emfont` custom element for dynamic font loading
- Register `md-emfont` in component index
- Reformat `Article.tsx` and `index.ts` using double quotes and
  consistent spacing
- Fix indentation in `index.html`
2026-05-11 11:25:57 +08:00
hypercross d4de95b465 refactor: fix layout for merged decks in PrintPreview
Update PrintPreview to correctly handle dimensions and layer
configurations when multiple decks are merged. Instead of using the
base store for all cards, it now maps each card to its specific
source store to ensure correct grid positioning and styling.
2026-05-05 16:46:10 +08:00
hypercross 4953d33f0f feat: implement multi-deck merging for print preview
Introduce a deck registry to track all active deck instances. This
allows users to select and merge multiple decks with matching
dimensions into a single print preview and export session.
2026-05-05 16:30:49 +08:00
hypercross d099cf5758 refactor: use npm yarn-spinner-loader package 2026-04-14 20:26:56 +08:00
hypercross 163aa8c783 refactor: move yarn-spinner-loader to external dependency 2026-04-14 16:35:18 +08:00
hypercross c110bb08b5 fix: label css typo 2026-04-09 12:35:54 +08:00
hypercross 348dff82f4 refactor: add pull-2, icon label, icon repeat 2026-04-09 12:31:07 +08:00
hypercross 2aaca2c56f fix: md-bg articlePath passing 2026-04-09 11:53:24 +08:00
hypercross 685ff08b78 fix: fix audit & inline schema to file? 2026-04-03 10:13:41 +08:00
hypercross cd5741692a refactor: alignment icons 2026-03-31 22:32:53 +08:00
hypercross d8058fd224 refactor: hide original frame 2026-03-31 22:32:53 +08:00
hypercross 49fca8c18f fix: rotation 2026-03-31 22:32:53 +08:00
hypercross ceb2da8b1a refactor: layer transform controls 2026-03-31 22:32:53 +08:00
hypercross 56cabea109 refactor: layer editing ui 2026-03-31 22:32:53 +08:00
hypercross 831955e16e fix: csv loading 2026-03-31 22:32:52 +08:00
hypercross ea57cf8d2b refactor: layer alignment 2026-03-31 22:32:52 +08:00
hypercross 273f949839 refactor: details 2026-03-31 22:32:52 +08:00
hypercross 0aaf81057a fix: parsing issues 2026-03-26 11:46:33 +08:00
hypercross faf179a4fd docs: update 2026-03-26 11:24:28 +08:00
hypercross 228327913e refactor: icon mini styling 2026-03-25 18:08:32 +08:00
hypercross 3cd8cc54b7 fix: mini icons 2026-03-25 17:36:19 +08:00
hypercross 64ac6c4516 fix: card layer assets 2026-03-25 17:29:56 +08:00
hypercross 8af559fe1c refactor: invert dice interaction 2026-03-25 14:08:29 +08:00
hypercross 33d29252dc refactor: more toc 2026-03-25 11:00:32 +08:00
hypercross a7477666c7 refactor: toc behaviour 2026-03-25 10:49:15 +08:00
hypercross 3aaa991bd8 refactor: toc toggle 2026-03-25 10:26:06 +08:00
hypercross 32e91f7dc8 refactor: sidebar color 2026-03-25 09:42:58 +08:00
hypercross 028074e4f1 fix: columns 2026-03-23 22:22:01 +08:00
hypercross 6f8be557b4 fix: jest 2026-03-23 20:24:25 +08:00
hypercross 30ddcfc32d refactor: layout 2026-03-23 19:01:42 +08:00
hypercross f658fd3380 refactor: convert xdx tables by default 2026-03-23 18:57:55 +08:00
hypercross 8f6a6b96e2 feat: mothership character store 2026-03-23 01:13:19 +08:00
hypercross c5e091da08 fix: toc uri 2026-03-22 10:11:41 +08:00
hypercross 206e799f34 fix: toc details 2026-03-22 01:47:26 +08:00
hypercross 94abd3e469 refactor: toc on right on xl 2026-03-22 01:41:37 +08:00
hypercross fbc67175ae fix: scrolling 2026-03-22 01:18:53 +08:00
hypercross 4839985154 fix: csv 2026-03-22 00:27:59 +08:00
hypercross 68d57ac049 refactor: style 2026-03-21 19:09:54 +08:00
hypercross fbdb427532 refactor: md-roll-label and md-remix-label 2026-03-21 18:58:42 +08:00
hypercross f9d0620d3e fix: chinese prop names 2026-03-21 18:52:40 +08:00
hypercross 66e8564a34 feat: md-table weighted random 2026-03-21 18:42:50 +08:00
hypercross 0261061bcb refactor: md-table body column gen 2026-03-21 18:30:40 +08:00
hypercross 617fd17def feat: md-pins allow numbers 2026-03-21 18:16:41 +08:00
hypercross 6f57970711 feat: auto-convert tables 2026-03-21 17:53:06 +08:00
hypercross 6b411c2f24 feat: inline md-table 2026-03-21 17:48:30 +08:00
hypercross 3d9617f06c fix: host addr 2026-03-21 00:29:36 +08:00
hypercross 7a490b82df fix: toc 2026-03-20 09:01:21 +08:00
hypercross d19401373f fix: slugging 2026-03-19 11:26:59 +08:00
hypercross 71ab7523da fix: shutdown 2026-03-18 15:27:06 +08:00
hypercross e5ce8c20b5 fix: mcp serve 2026-03-18 15:19:55 +08:00
hypercross 5389345a00 feat: mcp serve preview 2026-03-18 14:47:56 +08:00
hypercross 1d2b4b3e1e feat: layer docs 2026-03-18 14:28:44 +08:00
hypercross 301f499494 feat: resources? 2026-03-18 13:25:01 +08:00
hypercross 8213092bb6 fix: docs 2026-03-18 13:02:50 +08:00
hypercross 4f9d295bd5 feat: mcp prompts 2026-03-18 12:13:15 +08:00
hypercross 62aff91a86 fix: mcp 2026-03-18 12:08:28 +08:00
hypercross eecf429a20 fix: env and __CONTENT_INDEX 2026-03-18 11:31:13 +08:00
hypercross a144af6015 fix: docs 2026-03-16 14:26:42 +08:00
hypercross 1f8f1b0c7d docs: usage 2026-03-16 13:58:13 +08:00
hypercross 342cf97a50 fix: parameters 2026-03-16 09:39:43 +08:00
hypercross cde2134b4b fix: svg parsing 2026-03-16 09:29:32 +08:00
hypercross c99f602efa refactor: some tweaks 2026-03-16 09:02:35 +08:00
hypercross a4e8e31921 fix: render issues 2026-03-15 19:24:40 +08:00
hypercross e92065d14c refactor: token viewer 2026-03-15 19:14:39 +08:00