Skip to content

Redesign "FAQ's" page#441

Open
greenwoodt wants to merge 21 commits into
mainfrom
faqs/faqs-section
Open

Redesign "FAQ's" page#441
greenwoodt wants to merge 21 commits into
mainfrom
faqs/faqs-section

Conversation

@greenwoodt

@greenwoodt greenwoodt commented Jun 22, 2026

Copy link
Copy Markdown
Member

This PR creates the FAQ section for the redesign of the site according to the design here: https://www.figma.com/design/4dRzG7s6PzatpgTlcXiABh/Web-decidim.org?node-id=1375-23294&m=dev

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added and improved FAQ search and filtering to help you quickly find relevant questions.
  • Bug Fixes

    • Enhanced filtering to match text case-insensitively, automatically open matching sections, and close them when the search is cleared.
  • Style

    • Updated FAQ layout to use native expand/collapse sections by type.
    • Refreshed FAQ styling, including the highlighted subtitle and a direct contact email link.
  • Content Updates

    • Revised multiple FAQ questions/answers, expanded association/governance content, and added partnership-related FAQ entries.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 86d1455b-d88b-4120-96b0-f45080728157

📥 Commits

Reviewing files that changed from the base of the PR and between af35f8c and 8afd5bb.

📒 Files selected for processing (1)
  • locales/en.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • locales/en.yml

📝 Walkthrough

Walkthrough

The FAQ page now uses native <details>/<summary> sections with search filtering. FAQ copy, labels, and question groupings were updated across the locale and data files, and the filter script now opens or closes sections based on search input.

Changes

FAQ Page Redesign and Content Refresh

Layer / File(s) Summary
FAQ content and grouping
locales/en.yml, data/faqs.yml
Multiple FAQ answers and prompts were rewritten, the association label changed, contact wording was updated, and the FAQ question groupings gained new entries plus a new partnerships section.
FAQ page structure
source/localizable/faqs.html.erb, source/partials/_faq-item.html.erb, tailwind.config.js
The FAQ template now renders section-level disclosure blocks with a search input and filter targets, the FAQ item partial always shows the question and answer, and Tailwind adds the related width and filter tokens.
FAQ search filtering behavior
source/javascripts/filter-by-content.js
Filtering now uses lowercase substring matching, toggles matching targets, opens enclosing <details> elements while searching, and closes all details when the search is cleared.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

enhancement

Suggested reviewers

  • NilHomedes
  • andreslucena

Poem

🐇 The FAQ burrow got a shiny new light,
With sections that open and search that feels right.
Old answers reshaped, new paths in the tree,
And red little emails now sparkle for me.
Hop, click, and lookup — the rabbit says “yes!”
This FAQ meadow is tidier, I guess.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: a redesign of the FAQ page.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch faqs/faqs-section

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.

@netlify

netlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Deploy Preview for decidim-website ready!

Name Link
🔨 Latest commit 8afd5bb
🔍 Latest deploy log https://app.netlify.com/projects/decidim-website/deploys/6a3e79080355000008f4fcdb
😎 Deploy Preview https://deploy-preview-441--decidim-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
source/javascripts/filter-by-content.js (1)

17-18: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Move RegExp creation outside the loop.

Creating a new RegExp object for every [data-filter-target] element is inefficient. Create it once before the loop to improve performance, especially for pages with many FAQ items.

♻️ Proposed refactor
 if (parent) {
+  const regex = new RegExp(value, "i");
   [...parent.querySelectorAll("[data-filter-target]")].forEach((x) => {
-    const matches = x.textContent.match(new RegExp(value, "i"));
+    const matches = x.textContent.match(regex);
     if (!matches) {

Note: This should be applied after fixing the ReDoS vulnerability mentioned in the previous comment.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@source/javascripts/filter-by-content.js` around lines 17 - 18, The RegExp
object is being created on every iteration of the forEach loop that processes
elements selected by querySelectorAll("[data-filter-target]"). Move the RegExp
creation outside the forEach loop by creating it once before the loop starts,
storing it in a variable, and then using that variable reference inside the
forEach callback where match() is called. This will prevent unnecessary RegExp
instantiation for each element.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@locales/en.yml`:
- Line 172: Remove the HTML `<span>` tags and embedded email from the i18n
string at locales/en.yml line 172 and replace it with a placeholder like
%{email}. Then update the template at source/localizable/faqs.html.erb line 13
where it renders the subtitle to pass the email as an interpolated parameter
using a template helper like tag.span() to wrap the email address with the
styling classes (underline, decoration-2, text-red-500) instead of embedding the
markup in the translation string. This keeps HTML out of i18n strings and
prevents ERB escaping issues.

In `@source/javascripts/filter-by-content.js`:
- Around line 17-28: The code creates a RegExp directly from unescaped user
input (the `value` variable) in the forEach loop, creating a ReDoS vulnerability
where malicious patterns can freeze the browser. Replace the RegExp matching
with safe case-insensitive string matching by converting both the text content
and the search value to lowercase and using the `.includes()` method instead of
`.match(new RegExp(value, "i"))`. This eliminates the regex compilation from
user input while maintaining the same filtering functionality.

In `@source/localizable/faqs.html.erb`:
- Line 40: The `group-open:` TailwindCSS variant used in the `group-open:block
hidden` class on line 40 of the faqs.html.erb template is not configured for
TailwindCSS v3. To fix this, either add the `group-open:` variant configuration
to your tailwind.config.js file, or replace the `group-open:block hidden` class
with `open:block hidden` to use TailwindCSS's built-in `open:` modifier for
`<details>` elements. The second approach is simpler and requires no additional
configuration.

---

Nitpick comments:
In `@source/javascripts/filter-by-content.js`:
- Around line 17-18: The RegExp object is being created on every iteration of
the forEach loop that processes elements selected by
querySelectorAll("[data-filter-target]"). Move the RegExp creation outside the
forEach loop by creating it once before the loop starts, storing it in a
variable, and then using that variable reference inside the forEach callback
where match() is called. This will prevent unnecessary RegExp instantiation for
each element.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 84b3c1ee-2d73-464d-a94d-d08b66c486e6

📥 Commits

Reviewing files that changed from the base of the PR and between 7c48b77 and 2dbd3fc.

📒 Files selected for processing (4)
  • locales/en.yml
  • source/javascripts/filter-by-content.js
  • source/localizable/faqs.html.erb
  • source/partials/_faq-item.html.erb

Comment thread locales/en.yml
Comment thread source/javascripts/filter-by-content.js
Comment thread source/localizable/faqs.html.erb
@julietapasetti

julietapasetti commented Jun 22, 2026

Copy link
Copy Markdown

Fist review FAQ's:

  • The content does not occupy the entire width of the page (desktop)
  • The first item is always open (desktop and mobile).
Captura desde 2026-06-22 13-44-46

@julietapasetti julietapasetti moved this from Design Review to In progress in New Web Design Jun 22, 2026
@greenwoodt

greenwoodt commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

Fist review FAQ's:

* [x]  The content does not occupy the entire width of the page (desktop)

* [x]  The first item is always open (desktop and mobile).

Done

@greenwoodt greenwoodt removed the request for review from julietapasetti June 22, 2026 12:46
@greenwoodt greenwoodt moved this from In progress to Design Review in New Web Design Jun 22, 2026
greenwoodt and others added 3 commits June 22, 2026 14:49
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@elsa-decidim elsa-decidim moved this from Copys review to In progress in New Web Design Jun 23, 2026
@elsa-decidim

Copy link
Copy Markdown
Contributor

Hello @greenwoodt copies are not updated. You can find all FAQs copies here: https://docs.google.com/document/d/1GM2HfcQMJ1VAABQapZU7YTcoMe8cghIme-ug4mfdSKI/edit?tab=t.0#heading=h.utgv9hbc60wm

@greenwoodt greenwoodt moved this from In progress to Design Review in New Web Design Jun 25, 2026
@greenwoodt greenwoodt moved this from Design Review to Copys review in New Web Design Jun 25, 2026
@greenwoodt greenwoodt moved this from Copys review to In progress in New Web Design Jun 25, 2026
@greenwoodt greenwoodt moved this from In progress to Copys review in New Web Design Jun 25, 2026
@greenwoodt

Copy link
Copy Markdown
Member Author

Hello @greenwoodt copies are not updated. You can find all FAQs copies here: docs.google.com/document/d/1GM2HfcQMJ1VAABQapZU7YTcoMe8cghIme-ug4mfdSKI/edit?tab=t.0#heading=h.utgv9hbc60wm

This is done and ready for review. You can view the translations in the locales/en.yml and tweak them directly as a suggestion if you wish @elsa-decidim.

@elsa-decidim

Copy link
Copy Markdown
Contributor

Hello @greenwoodt in the FAQs section there's a question missing:

I want to contribute to the project proposing new improvements. What can I do? ( In the Installation and license section)
imatge

The rest is perfect!

@greenwoodt

greenwoodt commented Jun 26, 2026

Copy link
Copy Markdown
Member Author

Hello @greenwoodt in the FAQs section there's a question missing:

I want to contribute to the project proposing new improvements. What can I do? ( In the Installation and license section)

The rest is perfect!

Added:

image

Going to assign to @andreslucena for a code review

@greenwoodt greenwoodt moved this from Copys review to Code Review in New Web Design Jun 26, 2026
@greenwoodt greenwoodt requested a review from andreslucena June 26, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Code Review

Development

Successfully merging this pull request may close these issues.

5 participants