Skip to content

Feature/persistent public shift filter#71

Open
postgnostic wants to merge 3 commits intoHaDiNet:masterfrom
postgnostic:feature/persistent-public-shift-filter
Open

Feature/persistent public shift filter#71
postgnostic wants to merge 3 commits intoHaDiNet:masterfrom
postgnostic:feature/persistent-public-shift-filter

Conversation

@postgnostic
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 15, 2026 14:54
@pablo-schmeiser pablo-schmeiser linked an issue Mar 15, 2026 that may be closed by this pull request
@pablo-schmeiser pablo-schmeiser added enhancement New feature or request good first issue Good for newcomers labels Mar 15, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds persistence for “public shift” filtering so a user’s preference to hide/exclude public shifts can be remembered across visits (not only via URL parameters).

Changes:

  • Introduces a CalendarFilter model (with migrations) to store per-user public-shift filter preferences.
  • Updates ShiftFilterMixin to load persisted filter state when no relevant query params are present and to persist changes when the filter form is valid.
  • Extends the shift filter form + template to support “Hide public shifts” and excluding public organizations.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/shiftings/shifts/utils/filter_mixin.py Persist/load public shift filter state via CalendarFilter; apply new public-shift Q filters.
src/shiftings/shifts/forms/filters.py Adds hide_public_shifts + exclude_public_orgs_field; computes list of public orgs to present.
src/shiftings/shifts/templates/shifts/template/shift_url_filter_form.html Renders new public-shift filter controls (hide + exclude-by-org accordion).
src/shiftings/cal/models/filter.py New CalendarFilter model to store preferences.
src/shiftings/cal/models/__init__.py Exports CalendarFilter.
src/shiftings/cal/migrations/0001_initial.py Creates CalendarFilter tables/relations.
src/shiftings/shifts/migrations/0007_alter_recurringshift_color_alter_shifttype_color.py Alters shift color defaults/samples (appears unrelated to stated PR goal).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

cal_filter.hide_public_shifts = cleaned_data.get('hide_public_shifts', False)
cal_filter.save()
cal_filter.hidden_public_organizations.set(
cleaned_data.get('exclude_public_orgs_field') or []
Copy link
Collaborator

Choose a reason for hiding this comment

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

This seems like an optional change, but would be better. When you implement or fix other features, please include this and squash it into the commit this belongs to.

@postgnostic
Copy link
Contributor Author

2 things todo:

  1. Fix the reset filters button
  2. add a second filter to only show certain organistaions or something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Calendar filters

3 participants