Skip to content

Layout for Open-Questions revised#3941

Merged
thorsten merged 3 commits intothorsten:mainfrom
d0ubIeU:A11y_openQuestion
Feb 4, 2026
Merged

Layout for Open-Questions revised#3941
thorsten merged 3 commits intothorsten:mainfrom
d0ubIeU:A11y_openQuestion

Conversation

@d0ubIeU
Copy link
Contributor

@d0ubIeU d0ubIeU commented Feb 4, 2026

Rework open-questions.twig to provide an accessible, responsive layout, optimized for screenreader
Fix:

  • empty collumn on missing permissions or content (disturbed high contrast mode)
  • Added semantic table structure (thead, tbody, caption) for improved accessibility and optimized display.
  • desktop uses a table with colgroup/aria attributes and mobile uses card-based presentation. -Appearance adapted to startpage
  • showActionColumn logic (based on user permission or presence of linked answers) and an info alert for invisible questions.
  • Update translations (msgQuestion2) to "Category / Question" in English and German to reflect the combined column label.
  • Update QuestionsController to allow guest submissions when records.allowNewFaqsForGuests is enabled (included in userHasPermissionToAnswer check).

Summary by CodeRabbit

  • New Features

    • Open questions list is now responsive: table on desktop, cards on mobile.
    • Conditional action buttons appear when answering or adding FAQs is allowed.
    • Shows count of questions awaiting moderation with a descriptive helper.
  • Improvements

    • Enhanced accessibility (ARIA, captions, descriptions) and visual refinements.
    • Updated label to "Category / Question" and added a new "Email to" translation.
    • Guests can be allowed to add FAQs when the setting is enabled.

Rework open-questions.twig to provide an accessible, responsive
 layout, optimized for screenreader
Fix:
- empty collumn on missing permissions or content (disturbed high contrast mode)
- Added semantic table structure (<thead>, <tbody>, <caption> for improved accessibility and optimized display.
- desktop uses a table with colgroup/aria attributes and mobile uses card-based presentation.
-Appearance adapted to startpage
- showActionColumn logic (based on user permission or presence of linked answers) and an info alert for invisible questions.
- Update translations (msgQuestion2) to "Category / Question" in English and German to reflect the combined column label.
- Update QuestionsController to allow guest submissions when records.allowNewFaqsForGuests is enabled (included in userHasPermissionToAnswer check).
@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

Responsive and accessible refactor of the open questions UI with conditional action-column logic; backend grants guest answer access when configured and exposes a new msgEmailTo translation; translations updated for category/question and email labels. (50 words)

Changes

Cohort / File(s) Summary
Template & UI
phpmyfaq/assets/templates/default/open-questions.twig
Replaced static table with responsive table/card layout, added accessible header attributes and aria-describedby, visible caption, dynamic column/colspan calculations, conditional action column (showActionColumn), mobile cards, waiting/notes section, and updated no-questions state.
Backend Controller
phpmyfaq/src/phpMyFAQ/Controller/Frontend/QuestionsController.php
Expanded userHasPermissionToAnswer logic to also allow guests when records.allowNewFaqsForGuests is enabled; passed new template variable msgEmailTo to the view.
Translations
phpmyfaq/translations/language_en.php, phpmyfaq/translations/language_de.php
Updated msgQuestion2 from "Question"/"Frage" to "Category / Question"/"Kategorie / Frage"; added new msgEmailTo entries ("Email to"/"E-Mail an").

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Controller as QuestionsController
  participant Config as Config/Permissions
  participant Template as open-questions.twig

  Client->>Controller: Request open questions page
  Controller->>Config: Check userHasPermissionToAnswer & records.allowNewFaqsForGuests
  Config-->>Controller: permissionFlags (userHasPermissionToAnswer, allowNewFaqsForGuests)
  Controller->>Template: render with vars (questions, showActionColumn, msgEmailTo, totals)
  Template-->>Client: responsive HTML (table or cards, optional action buttons)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

Improvement

Suggested reviewers

  • thorsten

Poem

🐰 I hopped through templates, tidy and spry,
I added cards that stack up high,
Guests may answer when settings say "go",
Labels clearer, and ARIA in tow,
A small rabbit's joyful UI hello!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: a revision/rework of the open-questions layout template with responsive and accessibility improvements.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@thorsten thorsten merged commit 7920c5d into thorsten:main Feb 4, 2026
7 checks passed
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