Shareable filter-state specification for tags, dates, roles, and status
Use one canonical address for every filtered list, so a copied link restores the same tags, dates, role, status, sort, and page in the signed-in app and on public lists. Filters combine with AND, the applied values are echoed in the response, and Back restores the view the person left.
What the comparison found
Read this table before implementation. Each row states a difference between the implemented surfaces in this pack and the correction in this specification.
| Area | Implemented today in this pack | Correction in this specification |
|---|---|---|
| Tags | My Library and My Answers use a tag filter on the device, and the guides index saved panel uses a topic field, but List pagination, sorting, and filtering names no tag parameter. A shared link therefore cannot restore a tag view. | Add one canonical tag parameter, defined below, with exact tag token matching and AND combination with every other filter. |
| Dates | Reports and the weekly quality table use a week or date range, and Search scope states different date bases for signed-in lists and the public demo, but List pagination, sorting, and filtering lumps date range into one row with no parameter name and no basis statement. | Use date_from, date_to, and week with one stated time basis per surface, echoed in data.filters, as defined below. |
| Roles | The guides index uses role as a discovery filter, and Search scope states that the role filter does not grant app permission, but List pagination, sorting, and filtering lumps role with eight other filters in one row with one fallback. | Use role as one allowlisted category filter with its own fallback, echoed value, and permission note, as defined below. |
| Status | Status means answer outcome, source status, or record state depending on the list, and Search scope states that unavailable, superseded, and handed off stay in separate buckets, but List pagination, sorting, and filtering gives status no allowlist and no bucket rule. | Use status as one allowlisted filter per endpoint with separate buckets, as defined below. |
| Page versus limit | List pagination, sorting, and filtering uses limit and offset with default 50 and maximum 200, while Search scope and the weekly quality table use page and pageSize with choices 5, 10, and 20 and default 5. | Send limit and offset to the server. Translate page and pageSize on the client only, never send both forms, as defined below. |
| Back-button behavior | The guides index adds a history entry while typing, terminology replaces the address only with no restore on Back stated, and My Answers replaces on typing and pushes on a discrete change with restore on Back and on a persisted page show. | Use replace on typing and push on a discrete change on every surface, with restore on Back and on a persisted page show, as defined below. |
Canonical URL parameters
Every list screen builds its address from data.filters, the applied sort, and the applied limit and offset. The server reads the same names. A name not in this table is not a filter.
| Parameter | Meaning | Default and fallback |
|---|---|---|
| q | Search words, trimmed. Empty means no text filter. | Omitted when empty. Token rule from Search scope applies on every surface. |
| tag | One tag from the tag list for that list, case-insensitive, matched as an exact tag token, not as a substring of a title. | Omitted means all tags. An unknown tag falls back to all for the tag filter only, the applied value is echoed, and every other filter still applies. |
| collection | One collection name or id for saved answers, or one department collection for sources. | Omitted means all collections. An unknown value falls back to all for this filter only. |
| role | One allowlisted role value for that list. On the guides index this is discovery only and it grants no app permission. | Omitted means all roles. An unknown value falls back to all for this filter only and is echoed as all. |
| stage and topic | One allowlisted stage value and one allowlisted topic value for guide and workspace lists. | Omitted means all. An unknown value falls back to all for that filter only. |
| status | One allowlisted status value for that endpoint, such as answered, not_answered, handed_off, approved, in_review, suspended, or retired where the endpoint states it. | Omitted means all statuses. An unknown value falls back to all for this filter only. Unavailable, superseded, and handed_off stay in their own buckets and are never merged into another bucket. |
| owner, assistant, channel | One allowlisted owner office, assistant, or channel value for that list. | Omitted means all. An unknown value falls back to all for that filter only. |
| date_from and date_to | Inclusive start date and exclusive end date in YYYY-MM-DD form, stating the filter range for submitted, created, or updated records as the screen labels it. | Omitted means the full range. A malformed date or a week with no matching bucket shows no rows and total 0, and does not reset to the full range. |
| week | One week bucket in YYYY-MM-DD form for weekly lists, used instead of date_from and date_to on those lists. | Omitted means all weeks. An unknown week shows no rows and total 0. |
| sort | Sort choice from the allowlist for that endpoint group in List pagination, sorting, and filtering. | Omitted means the endpoint default. An unknown sort falls back to the endpoint default and is echoed. |
| limit and offset | Maximum rows in one page and rows to skip, sent to the server on every signed-in list request. | Default limit 50, maximum 200, default offset 0, with fallback and clamping from List pagination, sorting, and filtering. The applied values are echoed. |
| page and pageSize, client only | One-based page and rows per page shown by a pager control, translated on the client to limit and offset before every request. | Translation is offset equals page minus 1 times pageSize, and limit equals pageSize. Page below 1 becomes page 1, page past the last page clamps to the last page, pageSize below 1 becomes 5, and pageSize above 100 becomes 100. Never send page or pageSize to the server and never send both forms in one request. |
Workspace scope is never a URL parameter. The server takes the college workspace only from the signed-in session, and a workspace value in an address never widens the scope. System view returns counts grouped by college only.
Combination rules for tags, dates, roles, and status
Every active filter narrows the same result set. A record must pass every active filter to appear.
| Combination | Combined result | Count shown |
|---|---|---|
| Tag plus role plus status | Only records that carry that exact tag, are in that role segment where the list states a role segment, and have that status. A tag match never overrides a role or status miss. | Total after all three filters, then rows on the page. |
| Tag plus date | Only records with that tag whose stated date falls inside date_from to date_to, or inside the week bucket where week is used. A record with the tag outside the range does not appear. | Total after both filters, with the time basis stated beside the count. |
| Role plus status plus date | Only records in that role segment, with that status bucket, inside the date range. Unavailable stays out of not_answered, superseded stays out of headline counts, and handed_off stays in the handoff count only. | Total after all three filters, rows on the page, and the separate bucket counts where the list records outcomes. |
| Tag plus role plus status plus date plus sort plus page | Apply the server workspace scope first, then tag, role, status, and date, then sort with the record id tie break, then page by limit and offset. | Total after all filters before pagination, rows on the page, and total recorded where the list records outcomes, as separate numbers. |
| Search words plus any filter above | Only records that match every search word under the token rule and pass every active tag, role, status, and date filter. | Total after search and all filters, then rows on the page. |
- Changing any filter, sort, or page size returns to offset 0 and page 1. Recording a new outcome keeps the current filter, sort, and page size and clamps the page when the filtered total changes.
- A status line never reports all recorded items as shown when a filter hides some. It reports the filtered count and the total recorded as two different numbers.
- Test and staff preview sessions are excluded from items and from the total and are labeled as excluded on every combination above.
Date basis, shareable address, and history
Use these rules on every surface so a copied link and a Back step restore the same view.
Date basis
- Signed-in lists use Monday 00:00 to the next Monday 00:00 in college local time for a week, and a range that starts at 00:00 on the start date and ends at 00:00 on the day after the end date in college local time.
- The public demo bucket is Monday 00:00 UTC and is labeled as UTC on screen. A UTC bucket is converted to college local time before it is counted in the signed-in app, and the basis used is stated in data.filters.timeBasis.
- Never mix the two bases in one count. Never copy a UTC week value into a college local date filter without conversion.
Shareable address
- Build the address from the applied values only, in this fixed order: q, tag, collection, role, stage, topic, status, owner, assistant, channel, date_from, date_to, week, sort, limit, offset.
- Omit q when empty, omit tag, collection, role, stage, topic, status, owner, assistant, channel, date_from, date_to, and week when set to all or empty, omit sort when it is the endpoint default, and omit limit when 50 and offset when 0, so the link stays short and the defaults stay in one place.
- Encode with URLSearchParams. Keep no search word, question text, token, or workspace id in the address beyond the filter values above.
- Copy link builds the address from data.filters, data.sort, data.limit, and data.offset in the response, never from the control values alone, so the link always matches the list behind the number.
History and Back-button behavior
- Typing in a search field waits 120 milliseconds, then applies the filter and uses replaceState, so typing adds no history entry per keystroke on any surface, including the guides index.
- A discrete change, such as a tag, date, role, status, collection, sort, clear, or pager choice, applies the filter and uses pushState, so Back restores the previous applied view.
- Clear search or clear filters removes the filter parameters from the address, uses pushState, restores the full list, and returns focus to the search field.
- On Back, Forward, and a persisted page show, read the address, set every control to the applied values, run the same filtered request, and do not push a new entry. Keep focus on the search field only where the screen already states that rule, and keep the heading and filters visible in the empty state.
- Terminology gains the same restore on Back as the guides index and My Answers, with the same count wording, showing X of Y, and the same empty state with one primary clear action.
Implementation checklist
Ship in this order through the normal build, with every existing test passing before the next step starts.
Step 1: Add the canonical parameters to the list helpers
In each list module, parse tag, role, status, date_from, date_to, and week with the fallback in the table above, and echo every applied value in data.filters with timeBasis for date filters.
Step 2: Apply AND combination and separate status buckets
Filter by tag, role, status, and date together in the count query and in the items query, keep unavailable, superseded, and handed_off in separate buckets, and keep the record id tie break on every sort.
Step 3: Translate page and pageSize on the client only
Convert page and pageSize to limit and offset before every request, clamp as stated above, and never send page or pageSize to the server.
Step 4: Align history on every surface
Change the guides index typing path from push to replace, add restore on Back and on a persisted page show to terminology, and keep My Answers on replace on typing and push on a discrete change.
Step 5: Build Copy link from the response
Build the shareable address from data.filters, data.sort, data.limit, and data.offset in the fixed order above, with defaults omitted, and show the copied link beside the count status.
Step 6: Add tests for the contract
Add tests that tag plus role plus status plus date narrows by AND, that an unknown tag, role, or status falls back for that filter only, that an unknown week shows total 0, that a shared link restores the same total and page, that typing adds no history entry, that a discrete change does, and that Back restores the applied view on the guides index, terminology, and My Answers.
Checks before you ship
Run each check on phone and desktop. If a check fails, fix it before you publish.
- Copy a link with tag, role, status, and date set, open it in a new window, and confirm the same controls, the same total, and the same page appear.
- Combine tag with role, status, and date, and confirm each combination narrows by AND and echoes the applied values in the count status.
- Enter an unknown tag, role, or status in the address and confirm only that filter falls back to all, while an unknown week shows total 0 and no rows.
- Type in search on the guides index, terminology, and My Answers, and confirm typing adds no history entry, a discrete change does, Back restores the applied view, and clear removes the parameters with focus on the search field.
- Change page or pageSize and confirm only limit and offset reach the server, with no page or pageSize in the request, and the total matches on page one and page two with no row repeated or skipped.
- Confirm a record from another college never appears in items or in the total for any combination above, and test sessions are excluded and labeled as excluded.
Follow List pagination, sorting, and filtering for the full request and response contract, Search scope for query scope and permission rules, and Read reports for counts by college and assistant.
Use one filter address everywhere
Start with one list, add tag, role, status, and date to its address, then apply the same contract to the next list.