Skip to content

Shared button styles, and tidy the Support Request Template admin - #40

Merged
paul999 merged 11 commits into
masterfrom
issue-28-29/srt-admin-polish
Sep 19, 2026
Merged

paul999 merged 11 commits into
masterfrom
issue-28-29/srt-admin-polish

Conversation

@paul999

@paul999 paul999 commented Sep 18, 2026

Copy link
Copy Markdown
Member

Follow-up to #39, after testing phpbb/phpbb-website-private#226 on the Docker site. It adds shared button styles for the website, reworks the Support Request Template admin, and fixes the Markdown editor's handling of required fields.

css/buttons.css (new): the website's buttons

  • What it is: the team tools' button styles. Until now they were a private include of the team pages in phpbb-website-private; they move here so every page of the Symfony site uses the same buttons.
  • How pages use it: put the buttons in an element with the class submit-buttons. button1 is the main action and button2 the others. Inputs, buttons and links look the same.
  • Variants: submit-buttons-inline puts a row next to other content, such as in a table cell. button-icon makes a square icon button.
  • Loading: it's linked from base.html.twig, not imported through index.css, so the old site's copy of the assets can't shadow it.

css/srt.css

  • Buttons: it no longer has button styles of its own and uses buttons.css instead.
  • Tables: the outcome and page text tables get fixed widths for their name columns. The order column holds only the drag handles.
  • Question form: hides the parts that don't apply to the chosen type. A yes or no question shows without its value and remove columns.
  • Busy states: a row being saved, and a button waiting for the server.
  • Editors: they start at 100px, grow with the text and scroll past 360px. Before, a fixed height cut long text off out of reach.

js/support/srt-admin.js

The admin pages rely on this script; there are no fallbacks for browsers without JavaScript.

Question form. It only shows what applies to the question's type (data-srt-types):

  • the answers for typed questions;
  • the releases and their rules for a phpBB version question only;
  • the awaited answer, once the question depends on another one;
  • the warning, once an answer or an outdated release warns.

On the same form:

  • "Only ask when" offers only questions on steps before the one in the step field.
  • Yes or no questions get their Yes and No rows. Switching away removes them again, as long as they were left untouched.
  • New answers come from an "Add an answer" button, which copies the form's <template> prototype. A new answer goes last.

Sorting.

  • Rows are dragged by a grip handle. With the handle focused, the arrow keys move a row too, and on the overview a question moves on into the step before or after.
  • On the overview, every move is saved at once: a POST to the order URL, with the CSRF token in X-CSRF-Token and a JSON answer. The steps renumber straight away and a new empty step appears. If the server refuses, everything goes back and the reason is shown.
  • The last step's only question can't start a new step, since that would be the same step, so the page says why.
  • A Back to the overview reloads it, so the order shown is current.

Deleting. A POST with _method=DELETE and the header token, after a confirm. Symfony routes it as DELETE; a real DELETE request is refused by the site's .htdev. Buttons show "Saving…" or "Deleting…" while they wait.

js/support/srt.js (new)

The generator itself. An answer that warns shows its warning right under its question as soon as it is picked, and hides it when another answer is chosen.

js/markdown-editor.js

  • Required editors: EasyMDE hides the textarea, so the browser couldn't point at a required editor left empty and just didn't submit. The editor now shows the browser's message under itself and puts the cursor in it. Only the first invalid field takes the cursor.
  • forceSync: the textarea follows every change, so the browser checks what was typed.

After merging

  • phpbb/phpbb-website-private#226: run composer update phpbb/website-assets. Until then its pages link buttons.css, which the pinned assets don't have yet.
  • phpbb/website: run the same update (phpbb/website#231 can carry it). .htdev serves the old site's copy of js/markdown-editor.js first, so the team tools would otherwise keep the old editor script.

Checked

Against phpbb/phpbb-website-private#226 (commit be302a48):

  • In a browser, with the server calls stubbed:
    • the overview's moves, including refused ones, an emptied step and a new step;
    • the keyboard moves;
    • the question form's types and the Add button;
    • deleting;
    • the editor's required-field message and scrolling.
  • On the Docker site: the same, tested by the maintainer.
  • Tests: the team pages' tests pass with the shared buttons.css instead of their own copy.

🤖 Generated with Claude Code

For the overview in the team tools (phpbb/phpbb-website-private#226):

- The move arrows are prosilver icon buttons, square and holding a
  chevron, in one centred row with the drag handle.
- The Add buttons under the tables get room before the next heading and
  lose the underline the page gives its links.
- The outcome and page text tables get fixed widths for their name
  columns.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 18, 2026 21:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The scoped CSS changes have no unresolved approval-blocking issues.

Pull request overview

Tidies the Support Request Template admin overview styling in css/srt.css.

Changes:

  • Aligns and sizes movement controls.
  • Styles action buttons and spacing.
  • Sets fixed table column widths.
File summaries
File Description
css/srt.css Updates scoped admin layout and control styling.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

For the question form in the team tools (phpbb/phpbb-website-private#226):

- js/support/srt-admin.js hides the parts marked with data-srt-types
  that do not apply to the chosen type, the version rules until a
  version list is chosen, the awaited answer until there is a condition,
  and the warning until an answer or an outdated release warns. A yes or
  no question fills blank rows with Yes and No and shows only what they
  do. Markdown editors that become visible are refreshed, as CodeMirror
  has no size while hidden.
- css/srt.css: [hidden] wins over prosilver's display rules, headings
  for the sub-sections, and the yes or no table without its order, value
  and remove columns.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@paul999 paul999 changed the title Tidy the Support Request Template overview Tidy the Support Request Template pages in the team tools Sep 18, 2026
- css/buttons.css: the website's own buttons, taken from the team tools
  (phpbb-website-private's internal/team/_buttons.css.twig) so every
  page can use them: button1 and button2 in a .submit-buttons container,
  for inputs, buttons and links alike, plus submit-buttons-inline for a
  row inside other content and button-icon for a square icon button. It
  is its own file, linked from base.html.twig, so the old site's copy of
  the assets cannot shadow it.
- css/srt.css drops its own button styles in favour of those.
- js/support/srt-admin.js: the version rules follow the new phpBB version
  question type instead of a version list on any dropdown, and "Only ask
  when" offers only questions on earlier steps than the step field.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@paul999 paul999 changed the title Tidy the Support Request Template pages in the team tools Shared button styles, and tidy the Support Request Template admin Sep 18, 2026
paul999 and others added 8 commits September 18, 2026 23:28
- js/support/srt-admin.js: the empty rows offered for new answers are
  hidden behind the Add an answer button, which shows one per click and
  then adds rows from the page's template. Filling in Yes and No shows
  the rows it uses, and emptying them again hides them.
- css/srt.css: with the script, dragging sets the answers' order, so the
  order numbers, which stand in for it without the script, are hidden and
  the column only holds the handles.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ows for Yes and No when needed

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ys, arrows only without the script

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…X, no fallbacks

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…fused move, delete through a POST override

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…s a no-op new step, reloads a kept overview, and lets its editors scroll

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@paul999
paul999 merged commit 84e23ee into master Sep 19, 2026
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.

2 participants