galaxyproject / galaxyproject/brc-analytics
Legacy account routes: dedupe the three redirect stubs and add one for /account/preferences
- Dominant language
- TypeScript
- Stars
- 7
- Forks
- 11
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 15
Description
Part of #1707. Found in the review of #1689.
## Problem
Two things about the legacy account routes:
1. `sites/brc-analytics/pages/data/favorites.tsx`, `pages/assistant/saved.tsx`, and `pages/account/workflow-runs.tsx` are verbatim copies. `diff` between any two shows exactly two changed lines (`ACCOUNT_HREF` and the fallback sentence). `tests/views/accountRedirectStubs.test.tsx` already iterates them with `describe.each`. Any change to redirect behaviour (query-param preservation, meta refresh, renamed `/account` sections) has to be made and tested three times.
2. The fourth removed route, `/account/preferences`, got no stub at all. A bookmark to that URL, which is what the old `AuthButton` menu navigated to, now gets a Next.js 404 under `output: "export"`.
## Suggested fix
Extract one shared local `AccountRedirect({ hash, noun })` component (findable-ui's `Redirect` lacks the `.catch` and the fallback text, so a local one is warranted), use it from all three pages, and add a fourth one-line stub for `/account/preferences`.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with sites/brc-analytics/pages/data/favorites.tsx, pages/assistant/saved.tsx, and pages/account/workflow-runs.tsx, then read tests/views/accountRedirectStubs.test.tsx. Extract the shared redirect component while preserving the existing behavior and add a stub for /account/preferences. Run the redirect-stub tests and confirm all four legacy routes are covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- next.js, typescript
- Domain
- frontend, web-dev
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100