Skip to content

feat: surface user identity in log detail view and filters#2762

Merged
akshaydeo merged 3 commits intov1.5.0from
feature/04-16-feat_surface_user_identity_in_log_detail_view_and_filters
Apr 17, 2026
Merged

feat: surface user identity in log detail view and filters#2762
akshaydeo merged 3 commits intov1.5.0from
feature/04-16-feat_surface_user_identity_in_log_detail_view_and_filters

Conversation

@danpiths
Copy link
Copy Markdown
Collaborator

@danpiths danpiths commented Apr 16, 2026

Summary

Surfaces user identity in the logs UI: the log detail view now prefers the
display name over the raw user ID (falling back when no name is available)
and the log filter popover gains a User ID input so users can drill down to a
specific user's traffic. Pairs with the backend change that writes user_name
onto log rows.

Changes

  • ui/lib/types/logs.ts: add optional user_name?: string to LogEntry to
    match the new log column.
  • ui/app/workspace/logs/sheets/logDetailView.tsx: render
    log.user_name || log.user_id in the User field link, wrapped in a
    tooltip that shows the raw user ID when a name is present and a "Filter by
    user" hint otherwise. font-mono is applied only when the link renders
    the raw ID — human-readable names use the normal link style (matching the
    neighbouring Team / Customer / Business Unit identity fields).
  • ui/components/filters/filterPopover.tsx: add a User command group with a
    text input bound to the existing user_ids filter (single-value slot,
    matching how the same filter is already invoked from the log detail link).

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

cd ui
pnpm i || npm i
pnpm build || npm run build

Functional:

  1. Generate some log entries for a user whose user_name is populated (after
    the paired backend change). The log detail sheet should show the name as
    the primary label with the raw ID surfaced via tooltip.
  2. Generate log entries for a user without a user_name — the detail sheet
    should fall back to the user ID as the label and show a "Filter by user"
    tooltip.
  3. Open the log list filter popover → User section → type a user ID → the
    list should narrow to that user's entries. Clearing the input should
    remove the filter.
  4. Clicking the user link inside the log detail sheet should still navigate
    to the logs list pre-filtered by that user ID.

Screenshots/Recordings

UI change — screenshots/recordings to be attached in the PR description.

Breaking changes

  • Yes
  • No

user_name on LogEntry is optional; existing consumers that only look at
user_id remain unaffected.

Related issues

N/A

Security considerations

No auth or secret surface changes. The filter uses the existing authorized
logs endpoint; the display name rendered in the detail view is already stored
server-side and served under the same access controls as the rest of the log
row.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

Copy link
Copy Markdown
Collaborator Author

danpiths commented Apr 16, 2026

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 16, 2026

📝 Walkthrough

Walkthrough

Added optional user_name to log entries, updated the log detail view to prefer and style user_name with a tooltip showing the user_id, and introduced a new User filter section in the logs filter sidebar that binds a text input to filters.user_ids[0].

Changes

Cohort / File(s) Summary
Type change & detail view
ui/lib/types/logs.ts, ui/app/workspace/logs/sheets/logDetailView.tsx
Added user_name?: string to LogEntry. Log detail “User” now renders a Link wrapped in a Tooltip, displays `log.user_name
Filter sidebar UI
ui/components/filters/logsFilterSidebar.tsx
Inserted a new UserFilter FilterSection titled “User” (defaultOpen when active), placed between RoutingRulesFilter and SessionFilter. Renders a single text Input bound to `filters.user_ids?.[0]

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through logs to find a name,
I wrapped a link in tooltip frame,
Now names lead the way, IDs tucked behind,
A single filter for the curious mind. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main changes: surfacing user identity (both display name and filter functionality) in the log detail view and filters.
Description check ✅ Passed The pull request description is comprehensive and well-structured, covering all required template sections with clear explanations of changes, rationale, testing steps, and security considerations.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/04-16-feat_surface_user_identity_in_log_detail_view_and_filters

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 16, 2026

Confidence Score: 5/5

Safe to merge — all changes are additive UI enhancements with no breaking changes or logic errors.

No P0/P1 findings. The type addition is non-breaking, the conditional font-mono styling correctly targets raw IDs only, and the UserFilter follows the established SessionFilter pattern. All edge cases (empty input, multi-ID arrays from URL nav) are handled consistently.

No files require special attention.

Important Files Changed

Filename Overview
ui/lib/types/logs.ts Adds optional user_name?: string field to LogEntry at line 473 — purely additive, non-breaking.
ui/app/workspace/logs/sheets/logDetailView.tsx User field now renders `user_name
ui/components/filters/logsFilterSidebar.tsx New UserFilter component (lines 677–692) adds a text input bound to filters.user_ids[0]; consistent with SessionFilter pattern.

Reviews (6): Last reviewed commit: "feat: surface user identity in log detai..." | Re-trigger Greptile

Comment thread ui/app/workspace/logs/sheets/logDetailView.tsx Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Apr 16, 2026
@danpiths danpiths force-pushed the feature/04-16-feat_surface_user_identity_in_log_detail_view_and_filters branch from 122d4ef to fe3a994 Compare April 16, 2026 12:56
@danpiths danpiths force-pushed the feature/04-16-feat_show_live_access-profile-backed_usage_in_virtual_key_views branch 2 times, most recently from 3913095 to 1a2e6e1 Compare April 16, 2026 19:43
@danpiths danpiths force-pushed the feature/04-16-feat_surface_user_identity_in_log_detail_view_and_filters branch from fe3a994 to 94fba19 Compare April 16, 2026 19:43
@danpiths danpiths force-pushed the feature/04-16-feat_show_live_access-profile-backed_usage_in_virtual_key_views branch from 1a2e6e1 to ab41166 Compare April 17, 2026 07:42
@danpiths danpiths force-pushed the feature/04-16-feat_surface_user_identity_in_log_detail_view_and_filters branch 2 times, most recently from 9627995 to 2fac53f Compare April 17, 2026 10:44
@danpiths danpiths force-pushed the feature/04-16-feat_show_live_access-profile-backed_usage_in_virtual_key_views branch from ab41166 to c8e88fc Compare April 17, 2026 10:44
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ui/app/workspace/logs/sheets/logDetailView.tsx (1)

350-367: ⚠️ Potential issue | 🟡 Minor

Handle user_name-only rows instead of hiding the User field

Line 350 currently requires log.user_id, so if only user_name is present, the User row disappears. Since both fields are optional on LogEntry, render when either exists and only make it a link when user_id is available.

💡 Proposed fix
-						{log.user_id && (
+						{(log.user_id || log.user_name) && (
 							<LogEntryDetailsView
 								className="w-full"
 								label="User"
 								value={
-									<Tooltip>
-										<TooltipTrigger asChild>
-											<Link
-												to="/workspace/logs"
-												search={{ user_ids: [log.user_id] }}
-												className={`text-primary hover:text-primary/80 block min-w-0 cursor-pointer text-sm font-normal break-all underline-offset-2 hover:underline${log.user_name ? "" : " font-mono"}`}
-												data-testid="logdetails-user-link"
-											>
-												{log.user_name || log.user_id}
-											</Link>
-										</TooltipTrigger>
-										<TooltipContent sideOffset={6}>{log.user_name ? log.user_id : "Filter by user"}</TooltipContent>
-									</Tooltip>
+									log.user_id ? (
+										<Tooltip>
+											<TooltipTrigger asChild>
+												<Link
+													to="/workspace/logs"
+													search={{ user_ids: [log.user_id] }}
+													className={`text-primary hover:text-primary/80 block min-w-0 cursor-pointer text-sm font-normal break-all underline-offset-2 hover:underline${log.user_name ? "" : " font-mono"}`}
+													data-testid="logdetails-user-link"
+												>
+													{log.user_name || log.user_id}
+												</Link>
+											</TooltipTrigger>
+											<TooltipContent sideOffset={6}>{log.user_name ? log.user_id : "Filter by user"}</TooltipContent>
+										</Tooltip>
+									) : (
+										<span className="block min-w-0 text-sm font-normal break-all">{log.user_name}</span>
+									)
 								}
 							/>
 						)}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ui/app/workspace/logs/sheets/logDetailView.tsx` around lines 350 - 367, The
User row is currently gated on log.user_id so entries with only log.user_name
are hidden; change the render to show the LogEntryDetailsView when either
log.user_id or log.user_name exists, and inside render a Link (with search prop
and data-testid) only when log.user_id exists otherwise render plain text (still
wrapped in Tooltip/TooltipContent) showing the name and an appropriate tooltip
message; update references in this block (LogEntryDetailsView, Tooltip,
TooltipTrigger, Link, TooltipContent, log.user_id, log.user_name) accordingly so
the row appears for name-only rows and becomes a link only when user_id is
present.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@ui/app/workspace/logs/sheets/logDetailView.tsx`:
- Around line 350-367: The User row is currently gated on log.user_id so entries
with only log.user_name are hidden; change the render to show the
LogEntryDetailsView when either log.user_id or log.user_name exists, and inside
render a Link (with search prop and data-testid) only when log.user_id exists
otherwise render plain text (still wrapped in Tooltip/TooltipContent) showing
the name and an appropriate tooltip message; update references in this block
(LogEntryDetailsView, Tooltip, TooltipTrigger, Link, TooltipContent,
log.user_id, log.user_name) accordingly so the row appears for name-only rows
and becomes a link only when user_id is present.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 14f06f77-e851-4e57-9cd9-b3be697944be

📥 Commits

Reviewing files that changed from the base of the PR and between 9627995 and 2fac53f.

📒 Files selected for processing (3)
  • ui/app/workspace/logs/sheets/logDetailView.tsx
  • ui/components/filters/logsFilterSidebar.tsx
  • ui/lib/types/logs.ts
✅ Files skipped from review due to trivial changes (1)
  • ui/lib/types/logs.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • ui/components/filters/logsFilterSidebar.tsx

@danpiths danpiths force-pushed the feature/04-16-feat_surface_user_identity_in_log_detail_view_and_filters branch from 2fac53f to 849bad9 Compare April 17, 2026 11:05
@danpiths danpiths force-pushed the feature/04-16-feat_show_live_access-profile-backed_usage_in_virtual_key_views branch from c8e88fc to 1e7027c Compare April 17, 2026 11:05
@danpiths danpiths force-pushed the feature/04-16-feat_show_live_access-profile-backed_usage_in_virtual_key_views branch from 1e7027c to aefb353 Compare April 17, 2026 11:05
@danpiths danpiths force-pushed the feature/04-16-feat_surface_user_identity_in_log_detail_view_and_filters branch from 849bad9 to defc8f1 Compare April 17, 2026 11:05
akshaydeo
akshaydeo previously approved these changes Apr 17, 2026
Copy link
Copy Markdown
Contributor

akshaydeo commented Apr 17, 2026

Merge activity

@akshaydeo akshaydeo changed the base branch from feature/04-16-feat_show_live_access-profile-backed_usage_in_virtual_key_views to graphite-base/2762 April 17, 2026 17:24
@akshaydeo akshaydeo changed the base branch from graphite-base/2762 to v1.5.0 April 17, 2026 17:24
@akshaydeo akshaydeo dismissed their stale review April 17, 2026 17:24

The base branch was changed.

@akshaydeo akshaydeo dismissed coderabbitai[bot]’s stale review April 17, 2026 17:24

The base branch was changed.

@akshaydeo akshaydeo merged commit 1269897 into v1.5.0 Apr 17, 2026
13 of 16 checks passed
@akshaydeo akshaydeo deleted the feature/04-16-feat_surface_user_identity_in_log_detail_view_and_filters branch April 17, 2026 17:24
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.

3 participants