Skip to content

feat(admin): views are recorded once an hour and hidden from event lists unless asked for - #350

Merged
PiquelChips merged 1 commit into
mainfrom
feat/hourly-account-views
Nov 4, 2026
Merged

PiquelChips merged 1 commit into
mainfrom
feat/hourly-account-views

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

Every reload of an account's pages recorded another "Account details viewed", so a single investigation buried the account's real changes under a dozen identical rows in the admin dashboard's event lists. The views are worth keeping, since they're the only record of who read whose data, but one per sitting is enough.

  • Once an hour: Operator::record_view replaces the three places that recorded views. It skips the write when the same administrator, in the same dashboard session, already viewed the account within the hour; for the CLI, "same" means the same operator user and host. This also removes the OnceCell that Viewer used to record one view per page.
  • Hidden by default: the dashboard's overview, account page and events page now leave views out. The events page has a "Show views" / "Hide views" link, which applies at once and keeps the account and kind filters (a checkbox did nothing until Filter was pressed, since the dashboard loads no JavaScript). audit list gained --views, and filtering by the kind account_viewed still lists them.

Follows #346, which took views out of the owner's own history.

Proved after rebasing onto main with the auth-service and repository database tests on a scratch cluster (342/342 pass), an up-to-date SQLx cache and clean clippy. Two new tests cover it: a reload records no second view while another administrator records their own, and the events list includes views only when asked. A new browser test in admin.spec.ts shows and hides an account's views from the events page; it passes against a preview of this branch, as do the other dashboard tests the preview can run.

Reviewed with review-loop: 2 rounds with 2× gpt-6.1-sol and claude-opus-5-5. Verdict: approved

Note

Written by Claude Opus 5.5 in Claude Code (via T3 Code)

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0df68a65-817a-41a0-a498-95dd190900e3
Commits

Reviewing files that changed from the base of the PR and between c69655e and 87e85b9.

Files selected for processing: 20
  • README.md
  • apps/auth-service/src/account/subject.rs
  • apps/auth-service/src/account/tests.rs
  • apps/auth-service/src/admin/operator.rs
  • apps/auth-service/src/admin/service/accounts.rs
  • apps/auth-service/src/admin/service/events.rs
  • apps/auth-service/src/admin/service/recovery.rs
  • apps/auth-service/src/admin/tests/accounts.rs
  • apps/auth-service/src/cli/audit.rs
  • apps/auth-service/src/web/admin/lists.rs
  • crates/common/src/admin.rs
  • crates/database/.sqlx/query-0448dbb57f6793276820a304f03049c5626f1b0b3dda24acc79027ada2210203.json
  • crates/database/.sqlx/query-40b8beca8d5dbb61c48256f3bb7ef4f52b086fd440b6c80263a6bba18d8f0a95.json
  • crates/database/.sqlx/query-4833ab3d27cf74b6d52868bfce8e3b9b17eb8667bfb707be788e04e9f4065a95.json
  • crates/database/src/repositories/events/mod.rs
  • crates/ui/src/admin/events.rs
  • docs/architecture/rust-conventions.md
  • docs/architecture/surfaces.md
  • tests/browser/README.md
  • tests/browser/admin.spec.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips PiquelChips self-assigned this Nov 4, 2026
@PiquelChips PiquelChips added enhancement New feature or request security Anything security related admin The admin dashboard at admin.sourceorigin.dev labels Nov 4, 2026
@PiquelChips PiquelChips added this to the 0.1 milestone Nov 4, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in sourceorigin.dev Nov 4, 2026
@PiquelChips PiquelChips moved this from Needs Triage to In Progress in sourceorigin.dev Nov 4, 2026
@PiquelChips
PiquelChips force-pushed the feat/hourly-account-views branch 4 times, most recently from 46d88e9 to eaf05fd Compare November 4, 2026 21:52
…listed only when asked for

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PiquelChips
PiquelChips force-pushed the feat/hourly-account-views branch from eaf05fd to 87e85b9 Compare November 4, 2026 22:06
@PiquelChips
PiquelChips merged commit ed4d602 into main Nov 4, 2026
9 checks passed
@PiquelChips
PiquelChips deleted the feat/hourly-account-views branch November 4, 2026 22:13
@github-project-automation github-project-automation Bot moved this from In Progress to Done in sourceorigin.dev Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

admin The admin dashboard at admin.sourceorigin.dev enhancement New feature or request security Anything security related

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant