Skip to content

[616] Added expandable arrow for categories - #151

Merged
Anton-88 merged 11 commits into
mainfrom
616-add-expand-to-category-and-show-more-for-tags
Jun 6, 2025
Merged

[616] Added expandable arrow for categories#151
Anton-88 merged 11 commits into
mainfrom
616-add-expand-to-category-and-show-more-for-tags

Conversation

@Anton-88

@Anton-88 Anton-88 commented Jun 4, 2025

Copy link
Copy Markdown
Contributor

Added expandable arrow for categories

@Anton-88
Anton-88 requested a review from killev as a code owner June 4, 2025 20:05
@coderabbitai

coderabbitai Bot commented Jun 4, 2025

Copy link
Copy Markdown
Contributor
📝 Walkthrough

"""

Walkthrough

This change introduces an interactive expand/collapse mechanism for filter categories in the case studies page. It updates both the SCSS and HTML to implement a toggleable UI for filter categories, including new styles for transitions, accessibility improvements with ARIA attributes and keyboard controls, and support for reduced motion preferences.

Changes

File(s) Change Summary
website/modules/asset/ui/src/scss/_cases.scss Refactored .filter-category to use flexbox, added expand/collapse button and transitions, introduced hidden checkbox toggle, and updated styles for collapsible filter content with accessibility and reduced motion support.
website/modules/case-studies-page/views/index.html Replaced static filter label with a checkbox-based expand/collapse UI for each filter category, updating markup structure and adding ARIA attributes for accessibility.
website/modules/asset/ui/src/initCaseStudiesFilterHandler.js Added setupFilterAccessibility function to handle keyboard interaction and ARIA state updates for filter toggles; updated initialization to include accessibility setup with cleanup.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HTML
    participant JS
    participant CSS

    User->>HTML: Clicks expand/collapse button (label)
    HTML->>HTML: Checkbox toggles checked state
    HTML->>JS: Checkbox change event triggers ARIA attribute update
    JS->>HTML: Updates aria-expanded on label
    HTML->>CSS: CSS sibling selectors apply styles based on :checked
    CSS->>User: Filter content expands or collapses with transitions
    User->>JS: Presses Enter or Space on expand button
    JS->>HTML: Simulates checkbox toggle click
Loading

Suggested reviewers

  • yuramax
  • VitalyyP
  • IhorMasechko
    """

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a4dba21 and b221514.

📒 Files selected for processing (1)
  • website/modules/asset/ui/src/scss/_cases.scss (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • website/modules/asset/ui/src/scss/_cases.scss
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (actions)
  • GitHub Check: lint
  • GitHub Check: e2e-tests
  • GitHub Check: unit-tests
  • GitHub Check: security-scan

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Anton-88 Anton-88 self-assigned this Jun 4, 2025
@github-actions

github-actions Bot commented Jun 4, 2025

Copy link
Copy Markdown

🔍 Vulnerabilities of apostrophe-cms:test

📦 Image Reference apostrophe-cms:test
digestsha256:22c2961c21fddb43aee2cb96005e43b9345dd1bf809b9f7d9c61a77039141b33
vulnerabilitiescritical: 0 high: 5 medium: 0 low: 0
platformlinux/amd64
size289 MB
packages971
📦 Base Image node:23-alpine
also known as
  • 23-alpine3.22
  • 23.11-alpine
  • 23.11-alpine3.22
  • 23.11.1-alpine
  • 23.11.1-alpine3.22
digestsha256:b9d38d589853406ff0d4364f21969840c3e0397087643aef8eede40edbb6c7cd
vulnerabilitiescritical: 0 high: 0 medium: 0 low: 0
critical: 0 high: 1 medium: 0 low: 0 tar-fs 3.0.8 (npm)

pkg:npm/tar-fs@3.0.8

high 8.7: CVE--2025--48387 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Affected range>=3.0.0
<3.0.9
Fixed version3.0.9
CVSS Score8.7
CVSS VectorCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
EPSS Score0.063%
EPSS Percentile20th percentile
Description

Impact

v3.0.8, v2.1.2, v1.16.4 and below

Patches

Has been patched in 3.0.9, 2.1.3, and 1.16.5

Workarounds

You can use the ignore option to ignore non files/directories.

  ignore (_, header) {
    // pass files & directories, ignore e.g. symlinks
    return header.type !== 'file' && header.type !== 'directory'
  }

Credit

Thank you Caleb Brown from Google Open Source Security Team for reporting this in detail.

critical: 0 high: 1 medium: 0 low: 0 async 1.5.2 (npm)

pkg:npm/async@1.5.2

high 7.8: CVE--2021--43138 OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities

Affected range<2.6.4
Fixed version2.6.4, 3.2.2
CVSS Score7.8
CVSS VectorCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS Score1.061%
EPSS Percentile77th percentile
Description

A vulnerability exists in Async through 3.2.1 (fixed in 3.2.2), which could let a malicious user obtain privileges via the mapValues() method.

critical: 0 high: 1 medium: 0 low: 0 tar-fs 2.1.2 (npm)

pkg:npm/tar-fs@2.1.2

high 8.7: CVE--2025--48387 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Affected range>=2.0.0
<2.1.3
Fixed version2.1.3
CVSS Score8.7
CVSS VectorCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
EPSS Score0.063%
EPSS Percentile20th percentile
Description

Impact

v3.0.8, v2.1.2, v1.16.4 and below

Patches

Has been patched in 3.0.9, 2.1.3, and 1.16.5

Workarounds

You can use the ignore option to ignore non files/directories.

  ignore (_, header) {
    // pass files & directories, ignore e.g. symlinks
    return header.type !== 'file' && header.type !== 'directory'
  }

Credit

Thank you Caleb Brown from Google Open Source Security Team for reporting this in detail.

critical: 0 high: 1 medium: 0 low: 0 async 0.9.2 (npm)

pkg:npm/async@0.9.2

high 7.8: CVE--2021--43138 OWASP Top Ten 2017 Category A9 - Using Components with Known Vulnerabilities

Affected range<2.6.4
Fixed version2.6.4, 3.2.2
CVSS Score7.8
CVSS VectorCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS Score1.061%
EPSS Percentile77th percentile
Description

A vulnerability exists in Async through 3.2.1 (fixed in 3.2.2), which could let a malicious user obtain privileges via the mapValues() method.

critical: 0 high: 1 medium: 0 low: 0 connect-multiparty 2.2.0 (npm)

pkg:npm/connect-multiparty@2.2.0

high 7.8: CVE--2022--29623 Unrestricted Upload of File with Dangerous Type

Affected range<=2.2.0
Fixed versionNot Fixed
CVSS Score7.8
CVSS VectorCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS Score0.334%
EPSS Percentile56th percentile
Description

An arbitrary file upload vulnerability in the file upload module of Express Connect-Multiparty 2.2.0 allows attackers to execute arbitrary code via a crafted PDF file. NOTE: the Supplier has not verified this vulnerability report.

@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: 2

🧹 Nitpick comments (1)
website/modules/asset/ui/src/scss/_cases.scss (1)

190-196: Avoid a fixed max-height for the collapsible panel.
Using max-height: 1000px risks clipping if the tag list grows. Consider:

  • Dynamically computing height via JavaScript and animating height.
  • Utilizing a CSS variable (--collapse-max-height) set to cover expected content.
  • Falling back to height: auto transitions with JS.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5c399b1 and f62f7a9.

📒 Files selected for processing (2)
  • website/modules/asset/ui/src/scss/_cases.scss (4 hunks)
  • website/modules/case-studies-page/views/index.html (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: sonarqube
  • GitHub Check: security-scan
  • GitHub Check: e2e-tests

Comment thread website/modules/case-studies-page/views/index.html Outdated
Comment thread website/modules/asset/ui/src/scss/_cases.scss

@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: 2

🧹 Nitpick comments (1)
website/modules/asset/ui/src/initCaseStudiesFilterHandler.js (1)

90-97: Consider error handling for setup function failures.

The initialization function calls both setup functions but doesn't handle potential failures. While the current implementation is functional, consider adding error boundaries for production robustness.

 const initCaseStudiesFilterHandler = function () {
-  const filterCleanup = setupFilterLinkDetection();
-  const accessibilityCleanup = setupFilterAccessibility();
+  let filterCleanup, accessibilityCleanup;
+  
+  try {
+    filterCleanup = setupFilterLinkDetection();
+    accessibilityCleanup = setupFilterAccessibility();
+  } catch (error) {
+    console.error('Error setting up filter handlers:', error);
+    return function () {}; // Return empty cleanup function
+  }

   // Return combined cleanup function
   return function () {
-    filterCleanup();
-    accessibilityCleanup();
+    filterCleanup?.();
+    accessibilityCleanup?.();
   };
 };
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f62f7a9 and 3c94010.

📒 Files selected for processing (3)
  • website/modules/asset/ui/src/initCaseStudiesFilterHandler.js (1 hunks)
  • website/modules/asset/ui/src/scss/_cases.scss (4 hunks)
  • website/modules/case-studies-page/views/index.html (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • website/modules/case-studies-page/views/index.html
  • website/modules/asset/ui/src/scss/_cases.scss
⏰ Context from checks skipped due to timeout of 90000ms (6)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (actions)
  • GitHub Check: e2e-tests
  • GitHub Check: lint
  • GitHub Check: unit-tests
  • GitHub Check: security-scan
🔇 Additional comments (2)
website/modules/asset/ui/src/initCaseStudiesFilterHandler.js (2)

59-65: 🛠️ Refactor suggestion

Add null checks for robust ARIA attribute updates.

The function assumes the button element exists when updating aria-expanded. Add defensive checks to prevent runtime errors.

 const updateAriaExpanded = function (event) {
   const checkbox = event.target;
   const button = document.querySelector(`label[for="${checkbox.id}"]`);
   if (button) {
     button.setAttribute('aria-expanded', checkbox.checked.toString());
+  } else {
+    console.warn(`No label found for checkbox with id: ${checkbox.id}`);
   }
 };

Likely an incorrect or invalid review comment.


47-57:

Details

✅ Verification successful

Verify DOM structure assumptions for keyboard event handling.

The code assumes event.target has a for attribute (line 51), which suggests it should be a <label> element. However, the selector queries for .filter-category__expand-button elements. Ensure these elements are indeed labels with for attributes pointing to checkbox IDs.


🏁 Script executed:

#!/bin/bash
# Verify the DOM structure for filter expand buttons
ast-grep --pattern $'<label class="$_filter-category__expand-button$_" for="$_">
  $$$
</label>'

Length of output: 97


Here’s a deeper look across the repo to confirm what kind of elements use the filter-category__expand-button class and to examine the handler file in context:


🏁 Script executed:

#!/bin/bash
# 1. Search for usages of the expand-button class
rg "filter-category__expand-button" -n .

# 2. Dump the first 200 lines of the handler to see how it's wired up
echo "=== initCaseStudiesFilterHandler.js (lines 1–200) ==="
sed -n '1,200p' website/modules/asset/ui/src/initCaseStudiesFilterHandler.js

Length of output: 3953


DOM structure assumptions are correct

  • In website/modules/case-studies-page/views/index.html (line 87), all .filter-category__expand-button elements are <label> tags with a for="filter-toggle-{{ filterType }}" attribute.
  • Corresponding <input> checkboxes use id="filter-toggle-{{ filterType }}" and the .filter-category__toggle class.

No changes required.

Comment thread website/modules/asset/ui/src/initCaseStudiesFilterHandler.js Outdated
Comment thread website/modules/asset/ui/src/initCaseStudiesFilterHandler.js Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 5, 2025
@Anton-88 Anton-88 changed the title Added expandable arrow for categories [616] Added expandable arrow for categories Jun 5, 2025
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 5, 2025
VitalyyP
VitalyyP previously approved these changes Jun 5, 2025

@VitalyyP VitalyyP 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.

LGTM

@yuramax yuramax 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.

The functionality looks great to me! 💪

One small issue: when clicking on a tag, the highlighted area appears to be cut off on the sides.

It might be good to either fix the styling of the selection or remove the selection highlight altogether.

Screenshot-2025-06-05-at-16 51 50

@Anton-88
Anton-88 dismissed stale reviews from VitalyyP and coderabbitai[bot] via 537e2bc June 5, 2025 14:57
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 5, 2025
@Anton-88
Anton-88 requested review from VitalyyP and yuramax June 5, 2025 15:01
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 5, 2025
yuramax
yuramax previously approved these changes Jun 5, 2025

@yuramax yuramax 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.

Great work! 👍

IhorMasechko
IhorMasechko previously approved these changes Jun 5, 2025

@IhorMasechko IhorMasechko 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.

LGTM

@Anton-88
Anton-88 dismissed stale reviews from IhorMasechko, yuramax, and coderabbitai[bot] via b221514 June 5, 2025 19:44
@sonarqubecloud

sonarqubecloud Bot commented Jun 5, 2025

Copy link
Copy Markdown

@killev killev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good

@yuramax
yuramax self-requested a review June 6, 2025 08:45

@yuramax yuramax 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.

LGTM 👍

@Anton-88
Anton-88 merged commit 001d217 into main Jun 6, 2025
@Anton-88
Anton-88 deleted the 616-add-expand-to-category-and-show-more-for-tags branch June 6, 2025 09:00
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.

5 participants