Recent Activity feed - #75
Draft
a-effort wants to merge 3 commits into
Draft
Conversation
/api/logs/activity requires audit:read, which no default non-admin role holds, so every non-admin home load fired a guaranteed 403. Add an `enabled` option to useRecentActivity, mirroring useSystemHealth's flag for the admin-only /version probe, and gate the home call on it. Signed-off-by: Ahmad Al Tamimi <altamimi.dev@gmail.com>
?view=activity fell through to the "coming soon" placeholder; the spike
had shipped the plumbing (types, api client, hook, fixture, MSW handler)
but never the list itself. Adds ActivityView and wires it into the
Dashboard main-content switch.
- activityStatus.ts holds the one status -> {icon, tone} map, using the
set ui/sonner.tsx already ships. Keeping it in a single record is what
makes the app-wide token rollout (#62) a one-file change here. `info`
is unaccented, matching sonner, so high-volume read/execute rows
recede while errors and warnings carry.
- Filter tabs count `error`/`warning` the same way the mini cards do, so
the two can't disagree. `info` gets no tab of its own.
- The feed is requested at limit 100, not the hook's default of 10:
search filters the fetched window client-side, so a 10-row window
would make it near-useless.
- No self-gating. HOME_STATES.activity already declares
requiredPermission: "audit:read", so the page renders the skeleton
while permissions load and PermissionDenied when the caller lacks it.
useRecentActivity now keeps the original error instead of flattening it
to { message }. ApiError carries the status, and isPermissionDenied
needs the instance, so a 403 that slips past the page gate (stale or
coarser client permissions, team-switch race) can render as denied
rather than as a generic failure.
Signed-off-by: Anna Effort <anna.effort@ibm.com>
Measured against frame 4979-39243. - Text style updates. - Adds a `text-xxs` theme token (10px/16) for the step below Tailwind's built-in scale, matching Figma's own `text-xxs`. - Wraps the feed in the single bordered panel the design shows, with a divider under the tab row, replacing the loose filters + ringed list. - Drops the count from "All activity" and lets the remaining counts inherit their label colour rather than rendering muted. - TabsTrigger has no display utility, so the `gap-*` between label and count was inert; set inline-flex here. Signed-off-by: Anna Effort <anna.effort@ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds
ActivityView, the Recent Activity feed.?view=activitypreviously fell through to the "coming soon" placeholder: the earlier spike shipped the plumbing (types, api client, hook, fixture, MSW handler) but never the list itself.Blocked by #74
This view cannot load real data until #74 merges. The BFF strips its own
/apibefore forwarding, so/api/logs/activityreaches the gateway as/logs/activityand 404s. Every request from this view fails with "Recent activity could not be loaded." until that fix lands. #74 is small and independent, and was split out so it can be reviewed on its own.Verified locally with #74's branch checked out.
Depends on #69
The first commit here (
d967052) is Altamimi-Dev's from #69, which adds theenabledoption this hook needs. #69's head is on a fork, so GitHub will not let this PR base on it and that commit shows up in the diff. Once #69 merges I willgit rebase --onto origin/main d967052.Review this PR's own two commits, not
d967052.What's here
activityStatus.tsholds the single status to {icon, tone} map, using the setui/sonner.tsxalready ships. Keeping it in one record is what makes the app-wide token rollout ([Bug] Standardize status icons and colors app-wide #62) a one-file change here.error/warningthe same way the mini cards do, so the two cannot disagree.limit: 100rather than the hook's default of 10, because search filters the fetched window client-side.HOME_STATES.activityalready declaresrequiredPermission: "audit:read", so the page renders the skeleton while permissions load andPermissionDeniedwhen the caller lacks it.useRecentActivitynow keeps the original error instead of flattening it to{ message }.ApiErrorcarries the status andisPermissionDeniedneeds the instance, so a 403 that slips past the page gate (stale or coarser client permissions, team-switch race) renders as denied rather than as a generic failure.4979-39243, and adds atext-xxstheme token (10px/16) for the step below Tailwind's built-in scale.Open question:
infovssuccessServer-side,
infois a successfulread/executeaudit row, or a low-severity security event, and any security event with a missing or unrecognized severity falls back to it.Tests
10 new tests in
ActivityView.test.tsxcovering rows, relative timestamps, the screen-reader status label, tab counts, severity filtering, search, empty-feed versus empty-filter, the 403 path, the non-403 path and the loading skeleton.Full suite: 3096 passed, 1 skipped, 184 files. tsc, eslint and prettier clean.