Skip to content

[557] Display filter values above case studies#89

Merged
IhorMasechko merged 14 commits into
mainfrom
557-display-filter-values-above-case-studies
May 19, 2025
Merged

[557] Display filter values above case studies#89
IhorMasechko merged 14 commits into
mainfrom
557-display-filter-values-above-case-studies

Conversation

@IhorMasechko
Copy link
Copy Markdown
Contributor

  • Add selected filters display above case studies
  • Implement item count display
  • Relocate 'Clear all' button to new section
  • Add styles for filter tags display
  • Remove unnecessary padding and margins

- Add selected filters display above case studies
- Implement item count display
- Relocate 'Clear all' button to new section
- Add styles for filter tags display
- Remove unnecessary padding and margins
@IhorMasechko IhorMasechko self-assigned this May 15, 2025
@IhorMasechko IhorMasechko requested a review from killev as a code owner May 15, 2025 12:35
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 15, 2025

📝 Walkthrough

"""

Walkthrough

The changes update the case studies page by introducing a new filter summary section that displays the number of items found, selected tags, and options to remove individual tags or clear all filters. Corresponding SCSS styles are overhauled to support the new filter UI, replacing previous simpler tag and clear-all link styles.

Changes

File(s) Change Summary
website/modules/asset/ui/src/scss/_cases.scss Removed old .clear-all-link styles and added comprehensive new SCSS rules for .cs_filter-info, .items-count, .selected-tags-list, .selected-tag, .remove-tag, .clear-all, and related classes for the filter UI.
website/modules/case-studies-page/views/index.html Added a filter summary section showing item count, selected tags with individual remove links, and a "Clear all" link; removed the previous "Clear all" link from the tag filter list.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CaseStudiesPage (HTML/JS)
    participant SCSS Styles

    User->>CaseStudiesPage: Selects/deselects tags or clicks "Clear all"
    CaseStudiesPage->>CaseStudiesPage: Updates query/tags in URL
    CaseStudiesPage->>CaseStudiesPage: Renders filter summary section
    CaseStudiesPage->>SCSS Styles: Applies new filter info and tag styles
    User->>CaseStudiesPage: Clicks remove on a tag
    CaseStudiesPage->>CaseStudiesPage: Removes tag from filter, updates view
Loading

Possibly related PRs

Suggested reviewers

  • Anton-88
  • VitalyyP
  • killev
    """

📜 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 8894025 and 761019f.

📒 Files selected for processing (1)
  • website/modules/asset/ui/src/scss/_cases.scss (1 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 (4)
  • GitHub Check: e2e-tests
  • GitHub Check: unit-tests
  • GitHub Check: lint
  • 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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

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

266-279: Review flex container and breakpoint behavior
The .cs_filter-info block establishes a responsive flex layout with wrap/nowrap switches between mobile and medium breakpoints. Verify that at narrow widths the space-between justification doesn’t force unwanted wrapping, and at medium sizes the flex-start alignment keeps elements properly grouped. If mismatches occur, consider adding per-child flex or min-width constraints to stabilize the layout.


281-291: Enhance accessibility for dynamic counts
.items-count renders the filtered-items text. To ensure screen readers announce updates when filters change, add attributes like role="status" or aria-live="polite" in the HTML markup. This small tweak will improve usability for assistive-technology users.


306-322: Assess tag pill sizing versus content length
The .selected-tag pills use fixed heights (24px/28px) and small font sizes. Confirm longer tag labels won’t overflow or clip. If necessary, consider using vertical padding only and allowing height to grow naturally, which can prevent content truncation without manual height adjustments.


325-334: Ensure hit-area meets accessibility guidelines
.remove-tag is set to 16×16 px—below the recommended 24×24 px target for touch/click targets. To improve accessibility, wrap the icon in extra padding or increase the container size so the clickable area is at least 24×24 px.


336-355: Validate color contrast and hover states for clear-all
The .clear-all button uses light gray text on white with a red border. Check that the text–background contrast ratio meets WCAG AA. Also, consider adding a :hover background or border-color change to signal interactivity consistently with other buttons.


358-362: Scope the link color override if specificity issues arise
.clear-all-link forces link text to red. If you observe conflicts with other link styles, you may need to increase selector specificity (e.g. .clear-all a.clear-all-link) rather than using !important.


363-370: Remove redundant flex-direction: row
In .clear-all-content, flex-direction: row is the default and can be omitted to reduce verbosity:

 .clear-all-content {
- display: flex;
- flex-direction: row;
+ display: flex;
  justify-content: space-between;
  align-items: center;
  /* … */
 }

371-378: Standardize alignment technique for remove-icon
.remove-sign uses display: grid; place-items: center;, whereas .remove-tag uses inline-flex. For consistency, you could unify on one alignment approach (e.g. display: inline-flex; align-items: center; justify-content: center;) across both icon elements.

website/modules/case-studies-page/views/index.html (3)

5-10: Simplify conditional and boost accessibility
Instead of {% if data.query.tags.length >= 1 %}, consider Twig’s length filter: {% if data.query.tags|length > 0 %} for clearer intent. Additionally, add role="status" aria-live="polite" to the <p class="items-count"> to announce count updates to screen readers.


12-23: Consider control semantics for "Clear all"
You’re using an <a> with an href to clear filters. If this action resets UI state rather than navigating, a <button type="button"> might be semantically more appropriate. If you remain with an <a>, verify that other query parameters (e.g. search) are preserved or intentionally omitted.


24-41: Flatten redundant conditions & clean up wrapper
The inner {% if data.query.tags and data.query.tags.length %} is unnecessary given the outer check. You can remove the nested if to simplify the logic. Also, the <div class="selected-tags"> wrapper currently has no styles; consider removing it or styling it explicitly if you need a flex container separate from the UL.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 07437b2 and 3894561.

📒 Files selected for processing (2)
  • website/modules/asset/ui/src/scss/_cases.scss (1 hunks)
  • website/modules/case-studies-page/views/index.html (1 hunks)

Comment thread website/modules/asset/ui/src/scss/_cases.scss
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 15, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2025

🔍 Vulnerabilities of apostrophe-cms:test

📦 Image Reference apostrophe-cms:test
digestsha256:90a6a840e58593df7e12880b40b2bac65549c5016ae103936c2788ddaef689f1
vulnerabilitiescritical: 0 high: 2 medium: 0 low: 0
platformlinux/amd64
size284 MB
packages935
📦 Base Image node:23-alpine
also known as
  • 23-alpine3.21
  • 23.11-alpine
  • 23.11-alpine3.21
  • 23.11.1-alpine
  • 23.11.1-alpine3.21
digestsha256:169ee1b69bd3f5c7c8508a9919e8b367bba9dc7fa9a03097ec9f85d2e8179631
vulnerabilitiescritical: 0 high: 0 medium: 0 low: 0
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 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.

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 15, 2025
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 15, 2025
killev
killev previously approved these changes May 16, 2025
Copy link
Copy Markdown
Collaborator

@killev killev left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@yuramax yuramax left a comment

Choose a reason for hiding this comment

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

@IhorMasechko, you did a great job on the features and styles, but I found some inconsistencies and error, please see screenshots below:

  1. there are some inconsistencies in styles with mocks
    01_filters-PR-review

  2. the bug is that when you are not logged in as an administrator (viewing the page as a user), you can't see the filters, they are under the heading

02_filters-PR-review

Please fix the issues. If you need help with the consistent "close button" look, please let me know. Thank you!

@IhorMasechko IhorMasechko dismissed stale reviews from killev and coderabbitai[bot] via bc78d05 May 17, 2025 17:01
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 17, 2025
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 17, 2025
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 17, 2025
@IhorMasechko IhorMasechko requested review from killev and yuramax May 17, 2025 19:45
@IhorMasechko IhorMasechko enabled auto-merge (squash) May 17, 2025 19:45
Comment thread website/modules/asset/ui/src/scss/_cases.scss Outdated
Copy link
Copy Markdown
Contributor

@yuramax yuramax left a comment

Choose a reason for hiding this comment

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

@IhorMasechko, well done! 💯
Thank you for resolving the comments promptly 👍

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Collaborator

@killev killev left a comment

Choose a reason for hiding this comment

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

LGTM

@IhorMasechko IhorMasechko merged commit c7efde7 into main May 19, 2025
20 checks passed
@IhorMasechko IhorMasechko deleted the 557-display-filter-values-above-case-studies branch May 19, 2025 07:48
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.

3 participants