Skip to content

STORY#9-5: Bookings Filtering #249

Description

@Yalilix

Story

As a user, I want to filter weekly bookings so that I can quickly find events relevant to me.

Acceptance criteria

Add a filter menu to the Bookings toolbar using the booking data already available.

Supported filters:

  • Day of the selected week.
  • Building.
  • Booking type.
  • Room usage/type.
  • Minimum room capacity.
  • Time of day: morning, afternoon, or evening.

Filtering behaviour:

  • Filters apply locally to the currently loaded week without another network request.
  • Multiple filter categories combine using AND logic.
  • Multiple selections within one category use OR logic.
  • Search and filters work together.
  • Active filters are clearly indicated.
  • Users can remove individual filters or select “Clear all”.
  • An empty result shows a filtered-empty state, not the week-empty state.
  • Filters reset when leaving the Bookings tab; search behaviour remains unchanged.
  • Filter controls include accessibility labels and selected states.

User applies filters

  • Input:

    • The user selects one or more filter values.
  • Output:

    • The feed immediately shows matching bookings.
    • Existing date grouping and chronological ordering are preserved.
    • The toolbar indicates that filters are active.

No bookings match

  • Input:

    • The applied search and filters produce no results.
  • Output:

    • The app displays “No bookings match your filters”.
    • The user can clear all filters from the empty state.

Implementation notes

Use the existing WeeklyBooking fields:

  • start and end for day/time.
  • bookingType.
  • buildingID and buildingName.
  • usage.
  • capacity.

Keep filter state and filtering policy in BookingViewModels, not directly in SwiftUI views. Split the UI into a filter menu, reusable filter sections, and active-filter presentation.

Test plan

  • Test every filter independently.
  • Test AND/OR combinations.
  • Test filters combined with search.
  • Test clearing filters and filtered-empty state.
  • Confirm filtering does not trigger a GraphQL request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions