Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter steden tour (not done) #79

Open
wants to merge 10 commits into
base: release-candidate
Choose a base branch
from

Conversation

RukiyaTossou
Copy link

@RukiyaTossou RukiyaTossou commented Feb 13, 2025

What does this change?

This pull request will add a filter function. You can filter the cards by city

Resolves issue #74 in #59

How Has This Been Tested?

  • User test
  • Accessibility test
  • Performance test
  • Responsive Design test
  • Browser test

Images

before:
image
after :
image
The issues have a hover and click preview

How to review

src/lib/components/pages/TicketsOverview.svelte:

  • Added an if statement for the variable.
  • Changed
  • items to elements.
  • Added an active state in the CSS.
  • Made the tour card list scrollable (not tested yet).

Summary by CodeRabbit

  • Documentation
    • Revised release notes to include details of carousel responsiveness and interactivity improvements.
  • New Features
    • Enhanced the carousel to display content more flexibly on various screens.
    • Introduced an interactive city filter on the tickets page for easier selection.
  • Style
    • Added a decorative hover effect on the navigation menu for improved visual feedback.

Copy link

coderabbitai bot commented Feb 13, 2025

Walkthrough

This pull request updates the project documentation and several Svelte components. The changelog now features a renamed "aanpassingen" section with entries detailing carousel improvements such as responsive design and interactive enhancements. In addition, a new CSS rule is added in the Header component to create a hover effect on navigation items. Finally, the TicketsOverview component gains a dynamic city selection feature that replaces a static list with reactive buttons, alongside updated styling adjustments.

Changes

File(s) Change Summary
docs/Changelog.md Renamed the "Changed" section to "aanpassingen" and added entries for carousel adjustments, including removal of overflow: hidden, repositioning, button interactivity, and active states.
src/.../organisms/Header.svelte Added a global CSS rule for nav li:hover::after that displays a decorative underline with a transition effect when hovering over navigation list items.
src/.../pages/TicketsOverview.svelte Introduced a city selection feature with a reactive selectedCity variable, dynamic list rendering for city buttons via {#each}, and updated styling including hover and active states.

Sequence Diagram(s)

sequenceDiagram
    participant User as User
    participant Tickets as TicketsOverview
    User->>Tickets: Click on a city button
    Tickets->>Tickets: Invoke selectCity(city)
    Tickets->>Tickets: Update selectedCity (null or chosen city)
    Tickets->>UI: Re-render component with active button state
Loading

Possibly related PRs

  • Carrousel mobile version #69: Addresses similar carousel responsiveness and interactive enhancements, directly relating to the carousel updates documented in the changelog.

🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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. (Beta)
  • @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

netlify bot commented Feb 13, 2025

Deploy Preview for wogo-agency ready!

Name Link
🔨 Latest commit 74a7b19
🔍 Latest deploy log https://app.netlify.com/sites/wogo-agency/deploys/67ae1172d85690000880d261
😎 Deploy Preview https://deploy-preview-79--wogo-agency.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

Copy link

netlify bot commented Feb 13, 2025

Deploy Preview for wogo failed. Why did it fail? →

Name Link
🔨 Latest commit 74a7b19
🔍 Latest deploy log https://app.netlify.com/sites/wogo/deploys/67ae1172abb21d0008054a72

Copy link

@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 (4)
src/lib/components/pages/TicketsOverview.svelte (3)

9-11: Consider using English for code comments.

To improve maintainability and collaboration, consider translating the Dutch comments to English.

-// Als de waarde van city gelijk is aan "All", dan wordt selectedCity ingesteld op null.
-// Anders wordt selectedCity ingesteld op de waarde van city (de stad die is geselecteerd).
+// If the city value is "All", selectedCity is set to null.
+// Otherwise, selectedCity is set to the selected city value.

12-18: Simplify the selectCity function.

The function can be simplified using a ternary operator.

-const selectCity = (city) => {
-  if (city === "All") {
-    selectedCity = null;
-  } else {
-    selectedCity = city;
-  }
-};
+const selectCity = (city) => selectedCity = city === "All" ? null : city;

102-102: Improve cross-browser compatibility for hidden scrollbar.

The current implementation only hides the scrollbar in WebKit browsers. Add cross-browser support.

 overflow-x: auto;
+scrollbar-width: none; /* Firefox */
+-ms-overflow-style: none; /* IE and Edge */

 .tours-cards::-webkit-scrollbar {
   display: none;
 }

Also applies to: 107-109

docs/Changelog.md (1)

15-29: Improve changelog formatting and consistency.

  1. Consolidate duplicate date entries
  2. Fix list indentation (should be 2 spaces)
  3. Consider using English for consistency
-## 4-2-2025 [Unreleased]
-
-### aanpassingen
-- Carrousel interactief gemaakt. 
-    - Dit heb ik gedaan door in het bestand TickedCarousel.svelte te werken. 
-**Wat heb ik aangepast?** 
--De js code, zoadat de knoppen werken  
-- De scroll width aan gepast zodat elke kaar 1 voor 1 kan worden gescrolld 
-
-## 4-2-2025 [Unreleased]
-
-### aanpassingen
-- filters active state gemaakt 
-- buttons van de filters gemaakt zodat ze tabbaar zijn 
+## 4-2-2025 [Unreleased]
+
+### Changes
+- Made carousel interactive
+  - Updated TicketCarousel.svelte
+  - Implemented button functionality
+  - Adjusted scroll width for single card scrolling
+- Added filter improvements
+  - Implemented active states for filters
+  - Made filter buttons keyboard accessible
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

19-19: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


24-24: Multiple headings with the same content
null

(MD024, no-duplicate-heading)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 159e199 and 74a7b19.

📒 Files selected for processing (3)
  • docs/Changelog.md (1 hunks)
  • src/lib/components/organisms/Header.svelte (1 hunks)
  • src/lib/components/pages/TicketsOverview.svelte (3 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/Changelog.md

[misspelling] ~8-~8: Er is ook een Nederlandse term voor.
Context: ...released] ### aanpassingen - Carrousel responsive gemaakt. - Dit heb ik gedaan door ...

(NL_SIMPLE_REPLACE_RESPONSIVE)

🪛 markdownlint-cli2 (0.17.2)
docs/Changelog.md

9-9: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


19-19: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


24-24: Multiple headings with the same content
null

(MD024, no-duplicate-heading)

🔇 Additional comments (2)
src/lib/components/pages/TicketsOverview.svelte (1)

38-40:

❓ Verification inconclusive

Verify city filtering implementation.

The TicketCard component receives itemCollection but doesn't appear to filter based on selectedCity.


🏁 Script executed:

#!/bin/bash
# Search for filtering logic in TicketCard component
ast-grep --pattern 'export let itemCollection'

Length of output: 48


Missing city filtering logic in TicketCard
It appears that the TicketCard component is being passed itemCollection without any filtering based on selectedCity. Please verify whether:

  • City filtering should be performed within the TicketCard component.
  • Or the filtering is intended to occur upstream (e.g., in the parent component) before itemCollection is passed.

If filtering is meant to be implemented here, please add the logic to filter itemCollection based on the current selectedCity. Otherwise, please clarify the data flow so that the intended behavior is evident.

src/lib/components/organisms/Header.svelte (1)

206-214: LGTM!

The hover effect is well-implemented, using consistent design tokens and smooth transitions.

Comment on lines 24 to 35
<ul>
<li>Amsterdam</li>
<li>Rotterdam</li>
<li>Utrecht</li>
<button class:active={!selectedCity}
on:click={() => selectCity("All")}>
All</button> <!-- selected city word null -->
{#each citiesList as city}
<button class:active={selectedCity === city}
on:click={() => selectCity(city)}
tabindex="0">
{city}
</button>
{/each}
</ul>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix list structure and improve accessibility.

The buttons are placed directly inside a <ul> element, which is invalid HTML. Wrap them in <li> elements for proper list structure.

 <ul>
-  <button class:active={!selectedCity} 
-    on:click={() => selectCity("All")}>
-    All</button>
+  <li>
+    <button class:active={!selectedCity} 
+      on:click={() => selectCity("All")}>
+      All
+    </button>
+  </li>
   {#each citiesList as city}
-    <button class:active={selectedCity === city}
-     on:click={() => selectCity(city)}
-     tabindex="0">
-      {city}
-    </button>
+    <li>
+      <button class:active={selectedCity === city}
+        on:click={() => selectCity(city)}>
+        {city}
+      </button>
+    </li>
   {/each}
 </ul>

Note: Remove the explicit tabindex="0" as buttons are naturally focusable.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<ul>
<li>Amsterdam</li>
<li>Rotterdam</li>
<li>Utrecht</li>
<button class:active={!selectedCity}
on:click={() => selectCity("All")}>
All</button> <!-- selected city word null -->
{#each citiesList as city}
<button class:active={selectedCity === city}
on:click={() => selectCity(city)}
tabindex="0">
{city}
</button>
{/each}
</ul>
<ul>
<li>
<button class:active={!selectedCity}
on:click={() => selectCity("All")}>
All
</button>
</li>
{#each citiesList as city}
<li>
<button class:active={selectedCity === city}
on:click={() => selectCity(city)}>
{city}
</button>
</li>
{/each}
</ul>

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.

1 participant