Skip to content

[Hacktoberfest][Web2.0] Implement Monitoring Observers page - #1077

Open
cristian-ist wants to merge 1 commit into
commitglobal:feature/frontend2.0-hackdayfrom
cristian-ist:votemonitor-1006
Open

[Hacktoberfest][Web2.0] Implement Monitoring Observers page#1077
cristian-ist wants to merge 1 commit into
commitglobal:feature/frontend2.0-hackdayfrom
cristian-ist:votemonitor-1006

Conversation

@cristian-ist

Copy link
Copy Markdown

Summary

Finishes the monitoring observers page: the table now shows everything the
current admin app shows, the row actions work, and filtering, sorting and paging
all round-trip through the url.

Closes #1006

Pagination did not work

The page already declared pageNumber in its search schema, but the table was
left on the hook's default key, page. Changing page wrote ?page=2 into the
url, validateSearch dropped it as unknown, pageNumber stayed at 1, and the
list never moved. The table now passes pageNumber/pageSize explicitly, which
is what the issue is about in the first place.

Other fixes to the existing page

  • The build failed. rowAction was assigned and never read, which tsc
    rejects with TS6133. It went away with the dead action menu it belonged to.
  • The reset button never appeared. isFiltered read
    table.getState().columnFilters, which is always empty because every filter
    here writes to the search params instead. It now reads the url, and onReset
    navigates to a clean state rather than logging 'reset' to the console.
  • Typing flooded the history. The search box rewrote the url on every
    keystroke. It now keeps its value locally and rewrites the url once, 500ms
    after the user stops, matching how the forms page does it. Every filter also
    resets to the first page, since the current one may not exist after filtering.
  • The route did not prefetch. It now loads the list through
    ensureQueryData and strips empty filters out of the url.

What the table shows now

All six columns from the current app: name, email, observer tags, phone,
observer status as a badge, and latest activity at. Only the first two existed
before, even though the model already carried the rest.

Tags render the first three and collapse the rest into a +N badge with the
full list in its tooltip — an observer with many tags would otherwise push every
other column off screen. Observers who have never opened the mobile app show
"Never" rather than an empty cell.

Row actions

The menu matches the current admin app: View, Edit, Resend invitation
email
, in that order.

Resend is wired to monitoring-observers:resend-invites behind a confirmation,
and is only enabled for observers who are still Pending on a round that is not
archived — the same condition as today.

View links to the observer route, which is still a generated placeholder in this
app, so the entry will start working the moment that page is built. Edit stays
disabled: there is no edit route here at all yet. Both keep their place in the
menu rather than being dropped and re-added later.

Note

mapMonitoringObserverStatus in src/lib/i18n.ts is unused, and currently
unusable: it looks up observers.status.*, and those keys are not in the locale
files, so calling it prints the key instead of a word. The status badge writes
the value directly for that reason. Left untouched, but worth fixing or removing.

Verification

  • tsc reports no errors in the new code
  • eslint reports no errors beyond the repo-wide react/react-in-jsx-scope rule
  • prettier --check passes
  • knip reports nothing unused from this change

Checked against 24 observers on a test deployment: paging with a reduced page
size, sorting per column, and the status and tag filters all survive a reload and
a shared link.

@vercel

vercel Bot commented Aug 12, 2026

Copy link
Copy Markdown

@cristian-ist is attempting to deploy a commit to the Code for Romania Team on Vercel.

A member of the Team first needs to authorize it.

@cristian-ist
cristian-ist changed the base branch from main to feature/frontend2.0-hackday August 12, 2026 09:45
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.

[Hacktoberfest][Web2.0] Implement Monitoring Observers page

1 participant