Skip to content

feat: opening hours widget + newsroom categories#375

Merged
dmnktoe merged 5 commits into
mainfrom
cursor/opening-hours-blog-categories-5af1
May 1, 2026
Merged

feat: opening hours widget + newsroom categories#375
dmnktoe merged 5 commits into
mainfrom
cursor/opening-hours-blog-categories-5af1

Conversation

@dmnktoe

@dmnktoe dmnktoe commented May 1, 2026

Copy link
Copy Markdown
Owner

Description & Technical Solution

Opening hours widget

  • Adds an OpeningHoursWidget component with two variants:
    • now open: small green dot when currently open (no animation)
    • weekly overview: list of weekday labels and hours
  • Uses Europe/Berlin time for the “open now” calculation.
  • Integrated into:
    • Footer (now-open variant)
    • ContactInfo on the contact page (weekly overview)

Newsroom categories

  • Adds a minimal categories sidebar on the newsroom overview page with post counts.
  • Supports filtering via ?category=<slug>.
  • Makes the category badge on the newsroom detail page clickable (links to the filtered overview).

Styling tweaks (follow-ups)

  • Removes the border around the categories box.
  • Adds a double 2px underline under the categories headline.
  • Widens newsroom overview content to max-w-7xl while keeping breadcrumbs at max-w-5xl.
  • Updates grid spans to 9 (news list) / 3 (categories).

Checklist

  • I have commented my code, particularly in hard-to-understand areas.
  • Already rebased against main branch.

Screenshots

N/A (UI-only changes, can be added if requested)

Open in Web Open in Cursor 

Summary by CodeRabbit

Release Notes

  • New Features

    • Implemented category filtering system in newsroom with sidebar navigation and post counts per category
    • Introduced opening hours widget with current status and weekly schedule display modes
    • Made article category badges interactive to filter newsroom by selected category
  • Documentation

    • Added German and English locale strings for categories feature
  • Style

    • Adjusted layout alignment and spacing constraints
  • Chores

    • Updated code quality tool configuration

@coderabbitai

coderabbitai Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR introduces category filtering for the newsroom page with locale support, adds an OpeningHoursWidget component for displaying business hours, creates opening hours utilities and data structures for Europe/Berlin timezone, and updates related components and lint configuration.

Changes

Cohort / File(s) Summary
Configuration
package.json
Updated lint-staged eslint command to include -f json flag for JSON output formatting.
Localization
public/locales/en/news.json, public/locales/de/news.json
Added content.categories section with localized strings (title, filterLabel, clearFilter) to support the categories filtering feature in both English and German.
Newsroom Feature
src/app/[locale]/newsroom/page.tsx, src/components/templates/NewsArticle.tsx, src/components/templates/NewsCard.tsx
Newsroom page now accepts category query parameter, filters posts by category slug, computes per-category metadata, and renders a sidebar with category links and counts; layout widened to max-w-7xl. NewsArticle makes category badges clickable links to filtered newsroom. NewsCard adjusts cross-axis alignment from items-center to items-top for non-vertical orientation.
Opening Hours Feature
src/components/templates/OpeningHoursWidget.tsx, src/constants/opening-hours.ts, src/lib/opening-hours.ts
New OpeningHoursWidget component (two variants: nowOpen and weeklyOverview) powered by opening hours constants (Mon–Thu 07:30–16:00, Fri 07:30–14:30, Sat/Sun closed) and utility functions for timezone-aware status detection, time formatting, and localized day labels.
Component Integration
src/components/layout/Footer.tsx, src/components/templates/ContactInfo.tsx
Footer and ContactInfo now render OpeningHoursWidget with locale-aware props ('en' or 'de') using useLocale() hook, displaying current opening status and weekly schedules respectively.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant NewsroomPage
    participant PostsData
    participant UI

    User->>NewsroomPage: Navigate with ?category=slug
    NewsroomPage->>NewsroomPage: Extract & normalize<br/>searchParams.category
    NewsroomPage->>PostsData: Fetch all posts
    PostsData-->>NewsroomPage: Return posts list
    NewsroomPage->>NewsroomPage: Filter posts by<br/>category.slug match
    NewsroomPage->>NewsroomPage: Compute category counts<br/>from full posts list
    NewsroomPage->>UI: Render sidebar with<br/>category links + counts
    NewsroomPage->>UI: Render filtered posts<br/>+ "clear filter" link
    UI-->>User: Display newsroom with<br/>active category sidebar
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 A newsroom now sorted by tales yet untold,
Categories linked where the stories unfold,
And opening hours tick in Berlin's own time,
With widgets and filters, a feature sublime!
—Hoppy hops for this useful design! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the two main features added: opening hours widget and newsroom categories.
Description check ✅ Passed The description covers the technical solution, components added, and feature details, though the styling tweaks section is vague and the checklist items remain unchecked.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/opening-hours-blog-categories-5af1

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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@sentry

sentry Bot commented May 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.50000% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.16%. Comparing base (8ab8082) to head (feb03e4).

Files with missing lines Patch % Lines
src/lib/opening-hours.ts 75.55% 11 Missing ⚠️
src/components/templates/OpeningHoursWidget.tsx 64.00% 9 Missing ⚠️
src/components/layout/Footer.tsx 50.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #375      +/-   ##
==========================================
- Coverage   76.45%   76.16%   -0.29%     
==========================================
  Files          86       89       +3     
  Lines        1185     1263      +78     
  Branches      321      343      +22     
==========================================
+ Hits          906      962      +56     
- Misses        279      301      +22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dmnktoe dmnktoe marked this pull request as ready for review May 1, 2026 16:42
@dmnktoe dmnktoe merged commit 0912069 into main May 1, 2026
7 of 8 checks passed
@dmnktoe dmnktoe deleted the cursor/opening-hours-blog-categories-5af1 branch May 7, 2026 11:13
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.

2 participants