Skip to content

Store filter state as URL parameters on review/printer/admin/ysws-review pages#191

Merged
ArcaEge merged 4 commits intostagingfrom
copilot/update-filtering-functionality
Mar 30, 2026
Merged

Store filter state as URL parameters on review/printer/admin/ysws-review pages#191
ArcaEge merged 4 commits intostagingfrom
copilot/update-filtering-functionality

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 29, 2026

Filters on the review, printer, admin, and ysws-review pages are now stored as URL parameters. When a user applies filters and navigates away (e.g. to a project detail page), clicking back in the browser restores the exact filter they had applied.

Changes

For each of the 6 affected pages — Review, Print, Admin Orders, Admin Printer Fulfilment, Admin Printer Purchases, and YSWS Review:

+page.server.ts

  • Changed load() to accept url and read filter values from url.searchParams
  • Sensible defaults are applied on first visit (e.g. ['submitted'] for review, ['t1_approved'] for print, ['queued'] for printer fulfilment, ['printed'] for ysws-review)
  • Filter values are returned in data.fields so the form can pre-populate
  • Removed the actions export from ysws-review (no longer needed since filtering uses GET)
  • First visit is detected via url.searchParams.size > 0 — no sentinel parameter needed

+page.svelte

  • Changed filter form from method="POST" to method="GET"
  • Replaced use:enhance from $app/forms with navigating from $app/state for the pending/disabled button state (navigating.to !== null)
  • Updated all form?.fields.* references to data.fields.*

How it works

  • First visit: No URL params → url.searchParams.size === 0 → defaults applied
  • Apply filter: Form submits as GET → URL becomes e.g. ?status=building&status=t1_approved
  • Navigate away: User clicks a project card → goes to detail page
  • Navigate back: Browser back button → returns to filter URL → load() re-runs with URL params → filter is restored ✓

Security Summary

No security vulnerabilities were introduced. CodeQL found 0 alerts.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@ArcaEge
Copy link
Copy Markdown
Member

ArcaEge commented Mar 29, 2026

@copilot the apply button is always greyed out

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@ArcaEge The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 8945bb5d-e4ad-444c-9a45-d1626b26c97e

3 similar comments
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@ArcaEge The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 8945bb5d-e4ad-444c-9a45-d1626b26c97e

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@ArcaEge The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 8945bb5d-e4ad-444c-9a45-d1626b26c97e

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@ArcaEge The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 8945bb5d-e4ad-444c-9a45-d1626b26c97e

@ArcaEge
Copy link
Copy Markdown
Member

ArcaEge commented Mar 29, 2026

@copilot the apply button is always greyed out

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@ArcaEge The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 8945bb5d-e4ad-444c-9a45-d1626b26c97e

1 similar comment
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@ArcaEge The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 8945bb5d-e4ad-444c-9a45-d1626b26c97e

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@copilot the apply button is always greyed out

Fixed in commit 90a0f02. The issue was that navigating from $app/state is always an object (never null) — its .to property is null when not navigating. Changed the check from navigating !== null to navigating.to !== null.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@ArcaEge The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 5b0f4e84-497e-4957-8338-a4565a557f3a

1 similar comment
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@ArcaEge The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 5b0f4e84-497e-4957-8338-a4565a557f3a

@ArcaEge
Copy link
Copy Markdown
Member

ArcaEge commented Mar 29, 2026

@copilot add it to ysws-review too. also, remove the need for the filtered=1 parameter

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@ArcaEge The model claude-sonnet-4.6 is not available for your account. This can happen if the model was disabled by your organization's policy or if your Copilot plan doesn't include access to it.

You can try again without specifying a model (just @copilot) to use the default, or choose a different model from the model picker.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 5b0f4e84-497e-4957-8338-a4565a557f3a

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@ArcaEge Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 5b0f4e84-497e-4957-8338-a4565a557f3a

Sorry for the inconvenience!

2 similar comments
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@ArcaEge Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 5b0f4e84-497e-4957-8338-a4565a557f3a

Sorry for the inconvenience!

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@ArcaEge Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 5b0f4e84-497e-4957-8338-a4565a557f3a

Sorry for the inconvenience!

…am from all pages

Agent-Logs-Url: https://github.com/hackclub/construct/sessions/484fbb40-e36b-45f7-8b2a-6fd0c8390c18

Co-authored-by: ArcaEge <40526225+ArcaEge@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 29, 2026

@copilot add it to ysws-review too. also, remove the need for the filtered=1 parameter

Done in commit 18bf2a2:

  • ysws-review is now converted to GET with URL params (same pattern as the other pages), defaulting to ['printed'] on first visit
  • filtered=1 removed from all 6 pages — the server now uses url.searchParams.size > 0 to distinguish first visit (apply defaults) from an explicit filter submission

Copilot AI changed the title Store filter state as URL parameters on review/printer/admin pages Store filter state as URL parameters on review/printer/admin/ysws-review pages Mar 29, 2026
@ArcaEge ArcaEge marked this pull request as ready for review March 30, 2026 19:36
@ArcaEge ArcaEge merged commit 7f595c4 into staging Mar 30, 2026
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