Skip to content

Conversation

@yuramax
Copy link
Contributor

@yuramax yuramax commented May 26, 2025

This PR adds styles for displaying categories and tags in the case studies section, including:\n\n- Updated SCSS styles for categories and tags\n- Modified case studies page layout\n- Added check mark SVG icon

IhorMasechko and others added 14 commits May 21, 2025 10:06
- Refactor case-studies-page/index.js to fix ESLint errors while maintaining functionality
- Split large functions into smaller utility functions
- Fix race condition warnings using defensive copies
- Implement dynamic tag counting with proper modularization
- Update template to use the dynamic tag counts
- Remove invalid tagCountsMethods property from module top level
- Move tag counting logic into helper utility functions
- Simplify module structure to comply with ApostropheCMS conventions
- Fix linter errors related to function length
- Remove main search form from case studies page
- Add per-tag-type search input for filtering tags
- Implement client-side tag filtering with JavaScript
@yuramax yuramax requested a review from killev as a code owner May 26, 2025 06:12
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 26, 2025

📝 Walkthrough

Walkthrough

The changes update the SCSS and HTML template for the case studies page, restructuring and restyling the tag filter UI into a more organized filter section with categories, a search input, and refined tag item states. A CSS variable for the check mark image URL is introduced for consistent styling. No logic or exported entity changes were made.

Changes

File(s) Change Summary
website/modules/asset/ui/src/scss/_cases.scss Overhauled tag filter and case study list styles: new filter section layout, category headings, search input, tag item states, and updated tag link visuals.
website/modules/case-studies-page/views/index.html Updated filter markup: wrapped search and tag list in filter-content, changed placeholder text, adjusted tag count display, improved structure.
website/modules/asset/ui/src/scss/_base.scss Added global CSS custom property --check-mark-url for check mark image URL.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CaseStudiesPage
    participant FilterSection
    participant TagList

    User->>CaseStudiesPage: Load page
    CaseStudiesPage->>FilterSection: Render filter categories
    FilterSection->>TagList: Render tags with search input
    User->>FilterSection: Enter search text / select tag
    FilterSection->>TagList: Update displayed tags / selection state
    TagList->>CaseStudiesPage: Trigger filter update
    CaseStudiesPage->>User: Display filtered case studies
Loading

Possibly related PRs

Suggested reviewers

  • Anton-88
  • 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 06b696b and 3c6d03b.

⛔ Files ignored due to path filters (1)
  • website/public/images/check_mark.svg is excluded by !**/*.svg
📒 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)
🚧 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 (4)
  • GitHub Check: unit-tests
  • GitHub Check: e2e-tests
  • GitHub Check: security-scan
  • GitHub Check: lint

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.

@yuramax yuramax self-assigned this May 26, 2025
Copy link
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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9ec6a27 and 49ca94b.

⛔ Files ignored due to path filters (1)
  • website/public/images/check_mark.svg is excluded by !**/*.svg
📒 Files selected for processing (4)
  • website/modules/asset/ui/src/index.js (1 hunks)
  • website/modules/asset/ui/src/scss/_cases.scss (1 hunks)
  • website/modules/case-studies-page/views/index.html (2 hunks)
  • website/modules/case-studies-page/views/show.html (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
website/modules/case-studies-page/views/index.html (1)
Learnt from: yuramax
PR: speedandfunction/website#84
File: website/modules/case-studies-page/views/index.html:87-90
Timestamp: 2025-05-14T09:44:56.398Z
Learning: For the Case Study cards in website/modules/case-studies-page/views/index.html, the "type" and "industry" fields are temporarily hard-coded with values "Mobile Development" and "Manufacturing" as placeholders. These will be replaced with dynamic data ({{ article.type }} and {{ article.industry }}) in a future task.
🧬 Code Graph Analysis (1)
website/modules/asset/ui/src/index.js (2)
website/modules/asset/ui/src/swipers.js (1)
  • initAllSwipers (57-69)
website/modules/asset/ui/src/smoothCounters.js (1)
  • initSmoothCounters (58-78)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: e2e-tests
  • GitHub Check: lint
  • GitHub Check: unit-tests
  • GitHub Check: security-scan
🔇 Additional comments (8)
website/modules/case-studies-page/views/show.html (3)

42-47: LGTM! Good defensive programming and security practices.

The addition of existence checks (data.piece._industry and data.piece._industry.length) prevents template errors when the array is undefined, and the HTML escaping (| e filter) protects against XSS vulnerabilities.


52-57: LGTM! Consistent with previous improvements.

The existence check and HTML escaping are correctly applied to the case study type field, maintaining consistency with the industry field implementation.


93-99: LGTM! Completes the safety improvements.

The tech stack field now includes the same defensive measures as the other fields, ensuring consistent error prevention and security across all dynamic content areas.

website/modules/asset/ui/src/index.js (1)

75-75: LGTM! Proper integration into component lifecycle.

The function is correctly integrated into the initialization flow, ensuring it runs both on initial page load and after Barba.js page transitions.

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

81-152: LGTM! Well-structured filter UI supporting client-side search.

The restructuring effectively replaces the global search with category-specific filtering. The implementation includes:

  • Proper accessibility with meaningful placeholders
  • Consistent data-label attributes for JavaScript filtering
  • Maintained filter logic and URL building
  • Clean separation of concerns between search input and tag display

The new structure aligns well with the JavaScript implementation in index.js.


185-187: LGTM! Consistent safety improvements.

The existence check and HTML escaping for case study types match the defensive programming approach used in show.html, ensuring consistent error prevention across templates.

website/modules/asset/ui/src/scss/_cases.scss (2)

70-80: LGTM! Improved layout structure and spacing.

The updated flexbox layout with proper gap spacing and border styling creates a cleaner separation between the filter panel and content grid. The responsive adjustments maintain good UX across screen sizes.


86-165: LGTM! Comprehensive and well-organized filter styling.

The new filter UI styling is well-structured with:

  • Clear visual hierarchy with bordered sections and category separators
  • Properly styled search inputs with appropriate sizing and colors
  • Effective active state indication using check mark backgrounds
  • Consistent typography and spacing throughout
  • Good use of pseudo-elements for decorative borders

The styling effectively supports the new JavaScript filtering functionality and provides clear visual feedback to users.

@github-actions
Copy link

github-actions bot commented May 26, 2025

🔍 Vulnerabilities of apostrophe-cms:test

📦 Image Reference apostrophe-cms:test
digestsha256:72e15057862c19665d1185b8c1717df8aa82007d496ffd1dcdd04d46cdad246b
vulnerabilitiescritical: 0 high: 3 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/[email protected]

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/[email protected]

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.119%
EPSS Percentile32nd 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.

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

pkg:npm/[email protected]

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 26, 2025
IhorMasechko
IhorMasechko previously approved these changes May 26, 2025
Copy link
Contributor

@IhorMasechko IhorMasechko left a comment

Choose a reason for hiding this comment

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

LGTM

@VitalyyP VitalyyP dismissed stale reviews from IhorMasechko and coderabbitai[bot] via b4314e3 May 26, 2025 11:41
Copy link
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: 0

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

85-89: Consider adding border-radius to .tags-filter
You’ve added a border and max-width, which nicely contains the filter. For consistency with other UI components, you might introduce a $border-radius (e.g., $border-radius-sm) to soften the corners—this could improve visual cohesion.


91-93: Good structure for .filter-section and .filter-category
The padding, typography mixin, and separator (::after) correctly distinguish each filter block. One minor nit: consider replacing hard-coded values (15px 24px and the -24px offsets) with your design system’s spacing variables (e.g., $spacing-md, $spacing-lg) to maintain consistency and make future adjustments easier.

Also applies to: 94-100, 102-109


136-147: Active marker for .tag-item looks correct
Leveraging the .tag-link::before properties to inject the check-mark icon via background-image is a clean approach. Just double-check that /images/check_mark.svg resolves correctly in production and consider specifying background-size if you need pixel-perfect control.


150-196: Review focus & accessibility styles for .tag-link
You’ve added detailed :focus and :focus-visible rules to manage outlines on interactive tags, which is great for keyboard users. A few items to verify:

  1. Make sure the selector .tag-link + label::before matches your markup—if the <label> isn’t immediately after the link, this won’t take effect.
  2. Consider trusting :focus-visible alone (and dropping the generic :focus) once you’ve confirmed browser support, to simplify the rules.
  3. Validate that $gray-300 on white meets WCAG AA contrast requirements for body text.
    If all checks pass, these changes are solid.
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 49ca94b and b4314e3.

📒 Files selected for processing (1)
  • website/modules/asset/ui/src/scss/_cases.scss (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: lint
  • GitHub Check: e2e-tests
  • GitHub Check: security-scan
  • GitHub Check: unit-tests
🔇 Additional comments (3)
website/modules/asset/ui/src/scss/_cases.scss (3)

70-74: Approved: Layout adjustments for .cs_list
The added gap, border-top, padding-top, and align-items tweaks create clear separation and proper alignment at both small and medium breakpoints. The breakpoint overrides shift to flex-start and increase padding as expected.

Also applies to: 76-80


113-121: Verify focus state for .tag-search input
The focus rule strips most borders and removes left padding, leaving only the bottom border. This can cause a layout shift on focus and may be jarring. Please confirm this aligns with the design spec. If an underline-only focus is unintended, you could adjust to something like:

 .tag-search {
-  &:focus {
-    outline: 0;
-    border-left: 0;
-    border-right: 0;
-    border-top: 0;
-    padding-left: 0;
-  }
+  &:focus {
+    outline: none;
+    border-color: $gray-500;
+    box-shadow: 0 0 0 1px rgba($gray-500, 0.2);
+  }

Also applies to: 122-127


130-134: Clear list reset for .tags-list
Resetting list-style, padding, and margin is spot-on to ensure the tags list starts from a clean slate.

coderabbitai[bot]
coderabbitai bot previously approved these changes May 26, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes May 27, 2025
Anton-88
Anton-88 previously approved these changes May 27, 2025
Copy link
Contributor

@Anton-88 Anton-88 left a comment

Choose a reason for hiding this comment

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

LGTM

@VitalyyP VitalyyP requested review from VitalyyP and removed request for VitalyyP May 27, 2025 12:30
VitalyyP
VitalyyP previously approved these changes May 27, 2025
Copy link
Contributor

@VitalyyP VitalyyP left a comment

Choose a reason for hiding this comment

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

LGTM

@yuramax yuramax dismissed stale reviews from VitalyyP, Anton-88, and coderabbitai[bot] via 6db03fc May 27, 2025 18:49
coderabbitai[bot]
coderabbitai bot previously approved these changes May 27, 2025
@yuramax yuramax enabled auto-merge (squash) May 27, 2025 18:59
@yuramax yuramax requested review from Anton-88 and VitalyyP May 27, 2025 19:00
Copy link
Contributor

@Anton-88 Anton-88 left a comment

Choose a reason for hiding this comment

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

good job, but I found a few small things that needs to be fixed/changed

  • the width of container with tags(213px) is smaller than in figma(262px)
    image
  • some category lacks lines over their names
    image
  • for mobile version the border over the filter is too long
    image

- Add proper spacing and borders for filter sections\n- Improve tag count display with better spacing\n- Fix filter section padding and margins\n- Add responsive layout improvements\n- Clean up focus states and accessibility
refined filter layout, spacing, responsiveness, and accessibility
…f github.com:speedandfunction/website into 459-create-styles-for-displaying-categories-and-tags
@sonarqubecloud
Copy link

@yuramax yuramax requested a review from Anton-88 May 28, 2025 11:03
Copy link
Contributor

@Anton-88 Anton-88 left a comment

Choose a reason for hiding this comment

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

good job! everything works and looks correctly!

Copy link
Contributor

@IhorMasechko IhorMasechko left a comment

Choose a reason for hiding this comment

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

Great job!

Copy link
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

@yuramax yuramax merged commit b2b7c50 into main May 28, 2025
12 checks passed
@yuramax yuramax deleted the 459-create-styles-for-displaying-categories-and-tags branch May 28, 2025 12:23
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.

6 participants