Frontend: share formatters and move large pages to useReducer (series of PRs)
Maintainers usually reply within 1 day
@sisantaChhatoi is already working on this.
Since Nov 30, 2026.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 15/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- nextjs, react, typescript
- Domain
- frontend
Research direction
Start with the linked formatter PR and read web/src/lib/format.ts and web/src/lib/status.ts, then inspect the listed branches and their page _state/ folders. Run the relevant test:* scripts and npm run test:reducers; each step should also pass tsc --noEmit and next build. The series is already underway in the author's fork, and the issue invites maintainers to decide whether to accept its proposed split.
Written by the indexing model from the issue text.
Description
Proposal: frontend state refactor, split into a short series of PRs
Several large pages in web/ manage their state with many separate useState calls (up to ~40 in one component). Rules that span fields, like "a filter change goes back to the first page and clears the selection", are spread across handlers and effects, which makes these pages hard to change safely. Small helpers (byte/token/time formatters, the HTTP status colour) are also copied across many files with slightly different behaviour.
Following CONTRIBUTING.md (one focused change per PR, list queued changes in one issue), I'd like to submit this as a stacked series. Each step builds on the previous one, and each branch is already pushed to my fork if you want to look ahead:
- ✅ Shared display formatters and status colours, merged in #547.
src/lib/format.ts(formatBytes,formatTokens,formatDurationMs,formatShortDateTime) andhttpStatusToneinsrc/lib/status.ts, replacing ~30 copies in 21 files. Small visible normalizations: sizes over 1 GiB show as GB, token counts show25k/2.5Meverywhere. - ✅ Shared reducer slices +
useReducerfor the function pages, landed in 58bb812 (#692): small pure slices insrc/lib/reducers/(pagination, list, request, selection) and one reducer per page for commands, findings, traffic, assets, LLM records, sync and workspace. Addsnpm run test:reducers(node --test, with a tiny loader for the@/alias). useReducerfor the remaining components, split into page-group PRs of under 15 files / 2,500 lines each, per the review on #710:- #928: tasks list page (replaces #710)
- ✅ #861: task detail sessions tab (merged)
- ✅ #862: task detail page, overview and broadcast tabs (merged)
- ✅ #868: task detail assets, credentials, retests and coverage tabs (merged)
- ✅ #913: system LLM, tools and agents (merged)
- ✅ #914: system intercept and notify (merged)
- ✅ #915: system skills, settings, logs, MCP and chat bridge (merged)
- ✅ #916: chat, dashboard, shared browser and auth (merged)
- #926: agent editor, approval records and intercept card
- #927: traffic picker, link-traffic dialog, finding traffic panel and task templates
Scope rules I followed:
- Only components with 5+ related states were converted; smaller ones stay on
useState. - No intended behaviour change beyond the formatter normalizations in step 1. In step 2, the traffic page's six separate debounce timers become one, so edits to several filters within 300 ms produce one fetch instead of several.
- Each reducer lives in a
_state/folder next to its component. Tests cover the shared slices and the reducers with real logic (cross-field rules, merging, debouncing), not plain setters.
Verified on every step: tsc --noEmit, the existing test:* scripts, the new reducer tests, and next build.
If you'd prefer a different split or would rather not take parts of this, let me know before I open the next PRs.
- Dominant language
- Go
- Stars
- 18.7k
- Forks
- 7k
- Avg merge
- 10h 57m
- Merged PRs (30d)
- 494
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from BaaRai/ARTEX
-
bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
BaaRai/ARTEX#981 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
BaaRai/ARTEX#980 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
bug P2
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
BaaRai/ARTEX#812 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
question
Difficulty 4/5 1-2 days Newbie friendliness 35/100
BaaRai/ARTEX#983 · 4 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
bug P2
Difficulty 3/5 1-2 days Newbie friendliness 20/100
BaaRai/ARTEX#977 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
agent:ready
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
turbot/flowpipe#1162 · 1 comment ·
Maintainers usually reply within 1 day
-
LifetimeRemaining divides by zero when expireAfter is 0s, producing NaN disruption costsPossibly taken @weirong-ui claimed this today. Openkind/bug needs-priority needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
kubernetes-sigs/karpenter#3728 · 1 comment ·
Maintainers usually reply within 1 day
-
compaction: redundant exclusion checks after inRangePossibly taken @moodbased claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day