Conversation
backport of the improvements recently merged into #main (4.2) for the open-questions page.
📝 WalkthroughWalkthroughThe open-questions section is enhanced with accessibility features, responsive design (desktop table vs mobile card layout), permission-driven UI logic for displaying action columns, and conditional action buttons. Supporting controller logic expands permission conditions and template variables, while German and English translations are updated accordingly. Changes
Sequence DiagramsequenceDiagram
participant User as User/Browser
participant Controller as Controller<br/>(open-questions.php)
participant Template as Template<br/>(open-questions.twig)
participant Renderer as Browser Renderer
User->>Controller: Request open-questions page
Controller->>Controller: Evaluate permissions<br/>(FAQ_ADD or allowNewFaqsForGuests)
Controller->>Controller: Set userHasPermissionToAnswer flag
Controller->>Controller: Prepare template variables<br/>(openQuestions, showActionColumn, etc.)
Controller->>Template: Render with permissions & data
Template->>Template: Detect device type<br/>(mobile vs desktop)
alt Desktop View
Template->>Template: Render table with colgroup<br/>and conditional action column
Template->>Template: Add aria-labelledby attributes
else Mobile View
Template->>Template: Render card-based layout<br/>for each question
end
Template->>Template: Conditionally render action buttons<br/>based on permissions & answerId
Template->>Template: Render empty-state or<br/>waiting-questions banner if needed
Template->>Renderer: Return rendered HTML
Renderer->>User: Display page to user
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
This is a backport of the improvements recently merged into #main (4.2) for the open-questions page. The implementation has been adapted to match the architecture of version 4.1
Key Improvements:
Accessibility: Added semantic HTML5 table structure (thead, tbody, caption) and conditional ARIA attributes (aria-describedby) for better screen reader support.
Responsive Design: Replaced squashed tables on small screens with a modern card-based mobile view.
Logic Fix: Updated the permission check to properly include guests if records.allowNewFaqsForGuests is enabled.
UI/UX: Aligned the visual style (shadows, icons, and layout) with the start page for a consistent user experience.
High Contrast Mode: Fixed layout issues (empty columns) that previously disturbed the display in high contrast and dark modes.
Changes in this PR:
Modified open-questions.php to pass the correct boolean values to Twig.
Updated open-questions.twig with the new responsive and accessible structure.
Updated language files (en and de) to include or adjust variables like msgQuestion2 to reflect the combined "Category / Question" column.
Reference:
Backport of [#3941]
Summary by CodeRabbit
New Features
Improvements
Localization