Add a docs button #90

Closed
opened 2026-10-15 21:00:20 +00:00 by Syndria98 · 6 comments
Owner

Add a help button on the left of the settings button inside a campaign

Add a help button on the left of the settings button inside a campaign
Syndria98 added the ai-ready label 2026-10-15 21:00:20 +00:00
Agent added the working label 2026-10-15 21:36:45 +00:00
Collaborator

I'll start by exploring the codebase to find the settings button inside a campaign.

I'll start by exploring the codebase to find the settings button inside a campaign.
Collaborator

Now let me see how the docs page is opened elsewhere in the app.

Now let me see how the docs page is opened elsewhere in the app.
Collaborator

Now I'll implement the change in the campaign top bar:

Now I'll implement the change in the campaign top bar:
Collaborator

Now let me add a test alongside the existing docs entry-point test:

Now let me add a test alongside the existing docs entry-point test:
Collaborator

Done. Implemented Gitea issue #90.

What changed

frontend/app/components/viewer/TopBar.vue — a documentation button in the campaign top bar, on the left of the Settings button (Documentation · Settings · Exit):

<a class="btn-primary docs-button sound-click" href="/docs" target="_blank" rel="noopener noreferrer">
    {{ $t('main-menu.documentation') }}
</a>
  • Reuses the existing /docs page rather than a new window — the same destination the main menu already links to, and the same label (main-menu.documentation), so no new strings had to be added to the en/es/ca locales.
  • Opens in a new tab. /docs is a separate page (app/pages/docs/), and the campaign workspace holds its open notes only in memory (services/Content.js), so navigating in place would drop them. Only the campaign itself survives a reload (localStorage.selectedCampaignId). A new tab keeps the campaign exactly as it was; rel="noopener noreferrer" because the opened tab is not under the app's control.
  • A short .docs-button style block, because buttons are styled by the element selector in app/assets/css/main.scss — an <a> gets nothing from it. This mirrors what MainMenuWindow.vue already does for its .docs-link, and uses var(--color-border), var(--color-button-background), var(--color-button-hover), var(--color-button-active), var(--color-text) so both themes work.

tests/docs.test.js — one test next to the existing "the main menu points at the documentation": the top bar links to /docs under the same label, sits before the settings button, opens in a tab that cannot reach back, and carries its look in theme colours.

Verification

npm test from the repository root: 331 tests, 331 pass, 0 fail. I also checked the new test against the pre-change TopBar.vue from git show HEAD: and it fails there, so it does guard the behaviour.

Frontend dev server / pnpm --filter ./frontend run build were not run: no dependencies are installed in this checkout (node_modules is absent at the root and in frontend/), so the visual result is unverified in a browser.

One judgement call worth flagging

New tab versus staying in the app. The issue only says "add a help button on the left of the settings button"; I chose a new tab so reading the docs does not clear the note column. If the intent is to navigate to /docs in place, like the main menu does, it is a one-line change (drop target/rel).

Not committed or pushed, as instructed.

Done. Implemented Gitea issue #90. ## What changed **`frontend/app/components/viewer/TopBar.vue`** — a documentation button in the campaign top bar, on the left of the Settings button (`Documentation` · `Settings` · `Exit`): ```html <a class="btn-primary docs-button sound-click" href="/docs" target="_blank" rel="noopener noreferrer"> {{ $t('main-menu.documentation') }} </a> ``` - **Reuses the existing `/docs` page** rather than a new window — the same destination the main menu already links to, and the same label (`main-menu.documentation`), so no new strings had to be added to the `en`/`es`/`ca` locales. - **Opens in a new tab.** `/docs` is a separate page (`app/pages/docs/`), and the campaign workspace holds its open notes only in memory (`services/Content.js`), so navigating in place would drop them. Only the campaign itself survives a reload (`localStorage.selectedCampaignId`). A new tab keeps the campaign exactly as it was; `rel="noopener noreferrer"` because the opened tab is not under the app's control. - **A short `.docs-button` style block**, because buttons are styled by the element selector in `app/assets/css/main.scss` — an `<a>` gets nothing from it. This mirrors what `MainMenuWindow.vue` already does for its `.docs-link`, and uses `var(--color-border)`, `var(--color-button-background)`, `var(--color-button-hover)`, `var(--color-button-active)`, `var(--color-text)` so both themes work. **`tests/docs.test.js`** — one test next to the existing "the main menu points at the documentation": the top bar links to `/docs` under the same label, sits before the settings button, opens in a tab that cannot reach back, and carries its look in theme colours. ## Verification `npm test` from the repository root: **331 tests, 331 pass, 0 fail**. I also checked the new test against the pre-change `TopBar.vue` from `git show HEAD:` and it fails there, so it does guard the behaviour. Frontend dev server / `pnpm --filter ./frontend run build` were **not** run: no dependencies are installed in this checkout (`node_modules` is absent at the root and in `frontend/`), so the visual result is unverified in a browser. ## One judgement call worth flagging New tab versus staying in the app. The issue only says "add a help button on the left of the settings button"; I chose a new tab so reading the docs does not clear the note column. If the intent is to navigate to `/docs` in place, like the main menu does, it is a one-line change (drop `target`/`rel`). Not committed or pushed, as instructed.
Collaborator

Implementation is ready for review: #93

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

No dependencies set.

Reference: Syndria98/dragonroll#90