Skip to content

[iris] Encode jobs tab filter/sort/page state in URL query params#4633

Merged
Helw150 merged 3 commits intomainfrom
agent/20260410-fix-4632
Apr 10, 2026
Merged

[iris] Encode jobs tab filter/sort/page state in URL query params#4633
Helw150 merged 3 commits intomainfrom
agent/20260410-fix-4632

Conversation

@claude
Copy link
Copy Markdown
Contributor

@claude claude Bot commented Apr 10, 2026

Hydrate page, sortField, sortDir, nameFilter, and stateFilter from route.query
on mount and write non-default values back via router.replace on change. Follows
the existing ThreadDump.vue pattern so the browser back button restores prior
filter state and copied dashboard URLs reproduce the same jobs view.

Fixes #4632

Hydrate page, sortField, sortDir, nameFilter, and stateFilter from
route.query on load and write non-default values back via router.replace
on change. Follows the existing ThreadDump.vue pattern. This makes the
browser back button restore prior filter state and lets copied URLs
reproduce the same jobs view.

Fixes #4632

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4190ab781d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +59 to +61
const nameFilter = ref((route.query.name as string) ?? '')
const localFilter = ref((route.query.name as string) ?? '')
const stateFilter = ref((route.query.state as string) ?? '')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Normalize query filter params before storing in refs

route.query.name and route.query.state can be arrays when a URL has repeated params (for example ?name=a&name=b), but these lines cast them directly to string and store them in nameFilter/localFilter/stateFilter. In that case the refs hold arrays at runtime, so the filter controls and ListJobs request body can receive non-string values, producing incorrect filtering (or request validation failures) from a shareable URL. Parse these query values like sort/dir/page (e.g., accept only a single string and otherwise fall back to '').

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@claude Can you encode these in a better format? It doesn't matter if it's super readable as long as it's shareable and back button friendly

Copy link
Copy Markdown
Contributor Author

@claude claude Bot Apr 10, 2026

Choose a reason for hiding this comment

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

Claude finished @Helw150's task in 8m 21s —— View job


Normalize URL query params to handle array values safely

  • Read current implementation
  • Design better encoding format
  • Implement changes
  • Run pre-commit and tests
  • Push changes

Added a queryStr() helper that safely normalizes Vue Router query values (string | string[] | null) to a single string. When a URL has repeated params (e.g. ?name=a&name=b), Vue Router returns an array — the old code cast these directly to string, which would silently pass arrays into the filter refs and RPC requests.

Changes:

  • New queryStr(v) — takes string | string[] | null | undefined, returns first element if array, or '' for null/undefined
  • All route.query.* reads now go through queryStr() before being passed to parseSort/parseDir/parsePage or stored directly
  • Tightened parse function signatures from unknown to string since queryStr guarantees a string

Testing: ./infra/pre-commit.py --all-files --fix passes. 1594/1596 iris tests pass (2 pre-existing failures unrelated to this change: a Playwright locator test and a flaky timeout test). No frontend-specific test suite exists for the dashboard.

Vue Router query values can be string | string[] | null when a URL has
repeated params (e.g. ?name=a&name=b). Add a queryStr() helper that
always extracts a single string, falling back to '' for arrays/null.
Tightens parse function signatures from unknown to string.

Co-authored-by: William Held <Helw150@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Helw150 Helw150 enabled auto-merge (squash) April 10, 2026 20:21
@Helw150 Helw150 merged commit b7698bb into main Apr 10, 2026
37 of 38 checks passed
@Helw150 Helw150 deleted the agent/20260410-fix-4632 branch April 10, 2026 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-generated Created by automation/agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iris dashboard: encode filters in the URL so back button and link sharing are more friendly

2 participants