Make documentation a resizable window #95
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
I'll start by exploring the relevant parts of the codebase: the docs system, the window system, and the campaign button that opens docs.
Now I'll create the documentation window component:
Now let me update the tests:
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:WindowDefinitions.jsasdocumentation(titlewindows.documentation,closeclears it,movable), and made resizable viaSetResizable(id, true)+SetMinSize, sized to the viewport on open likeMapViewerWindow.[Foundry](/docs/foundry)) and the#sectionanchors 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.100vh/sticky), and the reading column setsuser-select: textso 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 callsOpenDocumentation().CreateWindowleaves 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 ofDocsView.vue(they were scoped there) to the shared stylesheet under.docs-markdown, so the/docspage and the window style the same HTML once. Both files say where they went.i18n —
windows.documentationadded toen/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
/docsis 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/docsdropped entirely — that last one also removesDocsView.vueand the layout tests from #85.Verification
npm testfrom the repo root: 349 pass, 0 fail.tests/docs.test.jswas 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+sassin 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.Implementation is ready for review: #97