Skip to content

Show the integration contract in the panel, on a Documentation page drawn from the file the binary ships - #59

Merged
ImBaphomettt merged 9 commits into
mainfrom
panel-documentation
Nov 11, 2026
Merged

ImBaphomettt merged 9 commits into
mainfrom
panel-documentation

Conversation

@ImBaphomettt

@ImBaphomettt ImBaphomettt commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Seven commits and two merges of main. The integration contract, resource/CONTRACT.md, could only be read in the repository. A Documentation page now draws it in the panel, from the file the binary ships, with what this server does of it: the contract's version, the name the bridge took for this start, and whether txAdmin's events are raised. The page writes none of the contract's text: an event or an export added to CONTRACT.md shows on the page without a change to the panel, and a test fails when the bridge raises an event, or has an export, that the contract does not document.

What changed

One Markdown reader (2fbe443)

  • The release notes' parser moved to web/src/lib/markdown.ts. It also reads tables (a | inside a code span stays in its cell), the language of a fenced block, and links within the text (#bans, observer_example), which it keeps apart from addresses. The release notes now draw a table; a link within their own text shows as its words.

One copy hook (0b03fdf)

  • web/src/lib/useCopy.ts copies, says "Copied" for two seconds, or says the browser refused (there is no clipboard outside a secure context). CopyField, CopyValue and the new page use it.

The contract in the binary (aeb54b0)

  • crates/observer-fxserver/src/contract.rs embeds resource/CONTRACT.md and the files of resource/observer_example, and reads from the bridge's own script the events it raises (its EVENTS table, and the events it raises by name: observer:playerRefused, observer:playerBanned) and its exports with their parameters.
  • Its tests fail when an event of the bridge has no section in the contract or no table row that says when it comes, when the contract keeps a section for an event the bridge no longer raises, when an export is never shown called, or when the example does not listen to an event.

What the running server was launched with (bbfee6e)

  • The supervisor's Status gains txadmin_events: whether the server that runs now raises txAdmin's events, as it was launched. A change of the launch setting applies from the next start, and until then the status still gives what the running server does.

GET /api/docs/integration (3c01883)

  • Behind the Session gate, as /about. It answers the contract, its version, the events, the exports, the example's files, and server: the bridge's name for this start, whether that server is still starting, and txAdmin's events now and from the next start. server is null for an account that does not hold View the dashboard, from which the status bar already keeps the server's state.

The Documentation page (fbc0a72)

  • /docs, Documentation at the rail's foot above Settings, for every account.
  • The contract section by section, one card each, beside contents that follow the reading (one button on phones). Each event has its card: when it comes, its fields, what the contract adds, and a handler to copy, its fields named from the event's table and its comments taken from the example's handler. Each export shows with its parameters at the head of the section that shows it called. The example's files fold under their names.
  • This server: the contract's version, the bridge's name for this start or that it does not run, and txAdmin's events now and from the next start, with a link to the launch setting for the owner. It is read again when the server starts or stops.
  • Under four sections the panel says where their effect shows: labels (Online now, the Players page, the profiles), observer:startChanges (File changes), bans (the Bans page, and the refusal message in the settings), txAdmin's events (this server's setting). A page the account does not open is named, not linked.
  • Every section has a link of its own, copied from its head, and a link to a section opens the page on it.
  • Ctrl K finds the sections, the events (also by a word of their name: rescheduled finds observer:restartRescheduled), the exports, and txAdmin's events by their own names, and opens the page on them. The page's search button opens it too.
  • README: the Integrations section, and the search's paragraph.

The page's tests on the coming contracts (2f41f6b)

  • Run against the contracts of player-kick-messages (5), allowlist-maintenance (6) and shutdown-hold (7, Let server resources hold a stop until they have saved, in contract 7 #55), three of the page's tests held to contract 4: the order of its events, the fields of observer:shuttingDown, and an export's name found once in its card. They now hold to whatever contract the branch ships.

Why

The people who write the server's resources work in the panel already; the contract was not there. Drawing the very text the binary ships keeps the page from drifting from the file, and the tests that held CONTRACT.md to the bridge now hold every event and export the bridge has.

Notes for review

  • The contract is not in web/src/i18n/en.ts: it is content the binary serves, in English, as the licences of the About page and the release notes are. The panel's own words around it are in the catalog.
  • Links within the page are plain anchors (web/src/docs/Anchor.tsx), not the router's Link: every one leads to the open page, and Link marks such a link as the current page.
  • The panel's notes hang on four headings by their address (NOTED in web/src/docs/Notes.tsx). Renaming Player labels, Bans, txAdmin's events or observer:startChanges makes DocsPage.test.tsx fail until NOTED follows.
  • The panel's tests read resource/ as Vite raw imports: server.fs.allow in web/vite.config.ts opens ../resource to the dev server, and nothing else of the repository.
  • The HTTP API is not on the page: it is the panel's own interface, with no token for integrations.
  • Starting then Running follow the server's state, not the bridge's first report, which the supervisor does not publish.
  • Follow the server's resources on a Resources page, and start, stop, restart or rescan them #57 merged while this was open: its rail entry and this one sit side by side in web/src/shell/nav.ts and in the search's test (05027c5). Of the branches still open, this one adds a conflict in README.md to Let server resources hold a stop until they have saved, in contract 7 #55 and entities, and none to Kick a player or everyone, and raise announcements and direct messages for the server's resources, in contract 5 #58, allowlist-maintenance or ban-templates-edits, beyond what main already gives them.

Verified

  • On the branch merged with main after Follow the server's resources on a Resources page, and start, stop, restart or rescan them #57 (05027c5), on Windows: cargo xtask check, that is fmt, icons, clippy with -D warnings with and without test-catalog, 3,303 Rust tests passed and none failed, bindings unchanged, and in web/ format, lint, type check, 823 tests and the build, under Node 26.13. The same passed on the first merge (c9f0bc0, after Run the fake FXServer tests on ports the system gives, so that two runs on one host no longer collide #56).
  • Each commit on its own, at its place in the branch: the panel's five steps for 2fbe443 and 0b03fdf; fmt, clippy with -D warnings and the tests of observer-fxserver for aeb54b0; the same for observer-fxserver and fake-fxserver, with the new supervisor test, for bbfee6e; cargo xtask bindings leaving web/src/api/generated unchanged, then the type check, for 3c01883.
  • The contracts of player-kick-messages, allowlist-maintenance and shutdown-hold, their four files of resource/ put in this checkout for the run: the tests of contract.rs pass on all three, and the page's tests, the search's included, since 2f41f6b.
  • In a browser (Chromium through Playwright), on the page as of fbc0a72, against a debug Observer with the fake FXServer and four players, two of them labelled: the contents, the links within the text, an address with a section opened afresh, Back, a handler and a section's address copied, the search from the page and from the settings, and the server stopped and started with txAdmin's events switched in between (the card follows without a reload, and the next start draws another name). At 1440, 1024, 375 and 320 px, dark and light, with no console error and nothing scrolling sideways. Also as an account that holds no permission: the contract alone, without This server.
  • GitHub Actions does not start the jobs at the moment (on Run the fake FXServer tests on ports the system gives, so that two runs on one host no longer collide #56 the Panel job ended in 3 seconds and the two others were skipped): the checks above are the CI's Rust and panel steps, run locally.

Not verified

  • No real FXServer: the bridge's Lua is unchanged, but the handlers the page offers to copy were not run on a server.
  • Linux, macOS, browsers other than Chromium, a screen reader.
  • cargo xtask e2e: no browser flow is added for the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant