Make documentation a resizable window #95

Closed
opened 2026-10-15 22:12:31 +00:00 by Syndria98 · 5 comments
Owner

Make that the documentation, instead of being in /docs, make it a window. So the button that is present inside a campaign to open the documentation, opens a resizable window with the docs instead of redirecting to /docs

Make that the documentation, instead of being in /docs, make it a window. So the button that is present inside a campaign to open the documentation, opens a resizable window with the docs instead of redirecting to /docs
Syndria98 added the ai-ready label 2026-10-15 22:12:31 +00:00
Agent added the working label 2026-10-15 22:12:32 +00:00
Collaborator

I'll start by exploring the relevant parts of the codebase: the docs system, the window system, and the campaign button that opens docs.

I'll start by exploring the relevant parts of the codebase: the docs system, the window system, and the campaign button that opens docs.
Collaborator

Now I'll create the documentation window component:

Now I'll create the documentation window component:
Collaborator

Now let me update the tests:

Now let me update the tests:
Collaborator

Done. Implemented issue #95.

What changed

frontend/app/components/windows/DocumentationWindow.vue (new) — the documentation as a window: contents sidebar on the left, the page in the middle, prev/next under it. It reads the same markdown through ~/services/Docs.js (GetDocsNav / GetDocsPage / GetDocsFirstSlug), so no page was duplicated. Key points:

  • Registered in WindowDefinitions.js as documentation (title windows.documentation, close clears it, movable), and made resizable via SetResizable(id, true) + SetMinSize, sized to the viewport on open like MapViewerWindow.
  • Navigation is the window's own state, not a route: sidebar entries and the pager are buttons. The links the markdown itself carries ([Foundry](/docs/foundry)) and the #section anchors are intercepted and answered inside the window (an unmatched external link opens a tab instead of dragging the campaign away), so nothing in it can leave the app.
  • Its own scroll containers (no 100vh/sticky), and the reading column sets user-select: text so docs text can be copied from a window.

frontend/app/components/viewer/TopBar.vue — the in-campaign button is now a real <button> (same classes as its neighbours, so it needs no special look) that calls OpenDocumentation(). CreateWindow leaves an already open window alone, so pressing it again does not send the reader back to page one.

frontend/app/assets/css/main.scss — the rendered-markdown rules moved out of DocsView.vue (they were scoped there) to the shared stylesheet under .docs-markdown, so the /docs page and the window style the same HTML once. Both files say where they went.

i18n — windows.documentation added to en/es/ca. AGENTS.md §5.1 mentions the window.

Scope note

The issue's second sentence scopes the change to the button inside a campaign, so /docs is kept as the public page and the main menu's Documentation button still points there (shared links stay alive). Say the word if you want the main menu button to open the window too, or /docs dropped entirely — that last one also removes DocsView.vue and the layout tests from #85.

Verification

npm test from the repo root: 349 pass, 0 fail. tests/docs.test.js was updated for the new behaviour — the top bar test now asserts the button opens the window and that the top bar no longer links out to /docs, plus new tests that the window is registered (with a component that exists, and an i18n title in all three locales), is resizable, reads the published pages through the docs service without navigating the app, follows the markdown's own links inside itself, and that the markdown styling sits where both readers reach it. Since the frontend's dependencies are not installed here, I additionally compiled the touched SFCs (script, template, scoped SCSS) and the whole stylesheet bundle with @vue/compiler-sfc + sass in a scratch directory: all compile, docs-markdown selectors still emitted. I did not run the dev server, so the window has not been clicked through in a browser.

Done. Implemented issue #95. ## What changed **`frontend/app/components/windows/DocumentationWindow.vue`** (new) — the documentation as a window: contents sidebar on the left, the page in the middle, prev/next under it. It reads the same markdown through `~/services/Docs.js` (`GetDocsNav` / `GetDocsPage` / `GetDocsFirstSlug`), so no page was duplicated. Key points: - Registered in `WindowDefinitions.js` as `documentation` (title `windows.documentation`, `close` clears it, `movable`), and made **resizable** via `SetResizable(id, true)` + `SetMinSize`, sized to the viewport on open like `MapViewerWindow`. - Navigation is the window's own state, not a route: sidebar entries and the pager are buttons. The links the markdown itself carries (`[Foundry](/docs/foundry)`) and the `#section` anchors are intercepted and answered inside the window (an unmatched external link opens a tab instead of dragging the campaign away), so nothing in it can leave the app. - Its own scroll containers (no `100vh`/`sticky`), and the reading column sets `user-select: text` so docs text can be copied from a window. **`frontend/app/components/viewer/TopBar.vue`** — the in-campaign button is now a real `<button>` (same classes as its neighbours, so it needs no special look) that calls `OpenDocumentation()`. `CreateWindow` leaves an already open window alone, so pressing it again does not send the reader back to page one. **`frontend/app/assets/css/main.scss`** — the rendered-markdown rules moved out of `DocsView.vue` (they were scoped there) to the shared stylesheet under `.docs-markdown`, so the `/docs` page and the window style the same HTML once. Both files say where they went. **i18n** — `windows.documentation` added to `en`/`es`/`ca`. **`AGENTS.md`** §5.1 mentions the window. ## Scope note The issue's second sentence scopes the change to the button inside a campaign, so `/docs` is **kept** as the public page and the main menu's Documentation button still points there (shared links stay alive). Say the word if you want the main menu button to open the window too, or `/docs` dropped entirely — that last one also removes `DocsView.vue` and the layout tests from #85. ## Verification `npm test` from the repo root: **349 pass, 0 fail**. `tests/docs.test.js` was updated for the new behaviour — the top bar test now asserts the button opens the window and that the top bar no longer links out to `/docs`, plus new tests that the window is registered (with a component that exists, and an i18n title in all three locales), is resizable, reads the published pages through the docs service without navigating the app, follows the markdown's own links inside itself, and that the markdown styling sits where both readers reach it. Since the frontend's dependencies are not installed here, I additionally compiled the touched SFCs (script, template, scoped SCSS) and the whole stylesheet bundle with `@vue/compiler-sfc` + `sass` in a scratch directory: all compile, docs-markdown selectors still emitted. I did not run the dev server, so the window has not been clicked through in a browser.
Collaborator

Implementation is ready for review: #97

Implementation is ready for review: https://git.aranroig.com/Syndria98/dragonroll/pulls/97
Agent added help wanted and removed working labels 2026-10-15 22:33:32 +00:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Syndria98/dragonroll#95