Skip to content

Styles and row sorting for the Support Request Template generator - #39

Merged
paul999 merged 3 commits into
masterfrom
issue-28-29/srt-assets
Sep 18, 2026
Merged

paul999 merged 3 commits into
masterfrom
issue-28-29/srt-assets

Conversation

@paul999

@paul999 paul999 commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

Styles and row sorting for the rebuilt Support Request Template generator: phpbb/phpbb-website-private#226, for paul999/phpbb-website-private#28 and #29.

The PR adds two new files and changes no existing ones.

css/srt.css

The generator's own stylesheet. Only its pages link it (/support/srt/ and its pages in the team tools); it is not imported through index.css.

  • Help icon (.srt-help, .srt-help-text): a question mark that shows the help text when hovered or tapped. The wizard's rows are dl elements, and prosilver clears their floats with overflow: hidden, which would cut the box off. Those rows clear with an ::after instead. An invisible strip keeps the box open while the pointer moves into it.
  • Buttons (.srt-buttons): Previous step and Next step side by side, Start over set apart. .srt-default-submit keeps the form's default "Next" button off screen, so Enter moves forward.
  • Admin pages (.srt-admin): layout for the pages in the team tools:
    • columns that line up across the step tables;
    • the drag handles and drop targets the script switches on.
  • Old rules: the file also carries the old generator's codebox, select and label rules that the new page relies on. Those can then leave website.css together with the old page.

js/support/srt-admin.js

Drag and drop sorting, built on the jQuery every page already loads.

  • Questions can move within a step, into another step, or into a new step. The new order is submitted straight away.
  • Answers of a question are reordered by renumbering their order fields.
  • Dragging only starts from a row's handle. A drag that is cancelled, or let go outside a table, puts the row back, and a new order is submitted only once.
  • Without the script, the pages still work through their arrow buttons and order fields.

After merging

Run composer update phpbb/website-assets in phpbb/phpbb-website-private (on #226). Also run it in phpbb/website, because .htdev serves /assets/ from the old site's copy first.

Checked

  • Checked in a browser against the rebuilt pages: the help box opens and stays open, the tab order skips the icon, and Enter picks the hidden Next button.
  • Dragging questions between steps and reordering answers both work. A cancelled drag, a stray click on a handle and a second drag during the submit are all handled.

🤖 Generated with Claude Code

paul999 and others added 2 commits September 18, 2026 19:50
For phpbb/phpbb-website-private#226 (paul999/phpbb-website-private#28
and #29), which rebuilds the generator at /support/srt/ and lets the
support team manage its questions in the team tools:

- .srt-help and .srt-help-text: a question-mark icon that shows the help
  text on hover, or on a tap on touch screens. The rows are dl elements,
  and prosilver clears their floats with overflow: hidden, which would
  cut the text off; the wizard's dl rows clear with ::after instead.
- .srt-buttons: Previous and Next together, Start over set apart.
  .srt-default-submit keeps the form's default button out of sight.
- .srt-admin: layout of the admin pages, including the drag handles and
  drop targets that js/support/srt-admin.js switches on.
- js/support/srt-admin.js: drag and drop sorting of questions (also
  between steps, submitted at once) and of a question's answers (by
  renumbering their order fields). Plain JavaScript, no library; the
  pages work without it.

The old generator's body.support-template rules stay until its page is
removed from phpbb/website. website.css?6 in index.css makes browsers
fetch the new rules.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
From review:

- A drag cancelled with Escape, or let go outside the tables, still
  saved the new order: dragover had already moved the row, and dragend
  submitted what it found. Rows now go back where they started unless
  they were dropped.
- A click on a handle that never became a drag left the row draggable,
  so selecting text in its fields dragged it; mouseup resets that.
- A second drag while the new order is being submitted is ignored, so it
  cannot add a second set of ids.
- Drag events aimed at a text node no longer throw.
- An invisible strip bridges the gap between the help icon and its box,
  so the box stays open while the pointer moves into it.

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

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.

🟡 Changes recommended

The help-text paragraph spacing rules are overridden by the more-specific #main p selector.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds styling and drag-and-drop sorting for the rebuilt Support Request Template generator.

Changes:

  • Adds generator help, button, and admin-page styles.
  • Implements question and answer row sorting.
  • Updates the stylesheet cache version.
File summaries
File Summary
js/support/srt-admin.js Implements drag-and-drop sorting behavior.
css/website.css Adds generator and admin styling; help-text paragraph selectors need higher specificity.
css/index.css Updates the cache-busting version.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

Comment thread css/website.css Outdated
Comment on lines +2210 to +2217
.srt-help-text p {
margin: 0 0 0.5em;
}

.srt-help-text p:last-child,
.srt-help-text ul:last-child {
margin-bottom: 0;
}
From review of #39:

- The rules are only used by the Support Request Template pages, so they
  move out of website.css into their own css/srt.css, which those pages
  link themselves; website.css and index.css are back as they were.
  srt.css also carries the old generator's codebox, select and label
  rules the new page relies on, so they can go from website.css with the
  old page.
- js/support/srt-admin.js uses the jQuery every page already loads
  instead of plain DOM calls. It behaves as before: rows are dragged by
  their handle, a cancelled drag puts the row back, and a new order is
  submitted once.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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