Skip to content

feat: add multi-value attribution cell with plural fallback for logs columns - #4865

Merged
akshaydeo merged 1 commit into
devfrom
07-02-fix_extra_column_accessors_for_logs_table
Jul 3, 2026
Merged

feat: add multi-value attribution cell with plural fallback for logs columns#4865
akshaydeo merged 1 commit into
devfrom
07-02-fix_extra_column_accessors_for_logs_table

Conversation

@impoiler

@impoiler impoiler commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Attribution columns in the logs table previously only displayed a single name or ID per log entry. This PR introduces support for rendering multiple attribution values (teams, customers, business units) in a single cell, with a compact "+N more" overflow indicator when values exceed the display limit.

Changes

  • Replaced the inline attributionCell helper with a dedicated AttributionCell component that accepts both singular (name, id) and plural (names, ids) props, resolving values via a plural-first fallback: plural names → singular name → plural IDs → singular ID.
  • Team, customer, and business unit columns now pass plural array fields (team_names, team_ids, customer_names, customer_ids, business_unit_names, business_unit_ids) alongside their singular counterparts.
  • Virtual key and routing rule columns now use virtual_key_name and routing_rule_name directly from the log entry rather than accessing nested objects.
  • Added virtual_key_name and routing_rule_name as top-level fields on the LogEntry type.
  • When multiple values are present, up to MAX_ATTRIBUTION_LINES (1) are shown with a +N more indicator; hovering reveals all values via the title attribute.

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
  1. Navigate to the Logs view.
  2. Enable the Team, Customer, and Business Unit columns.
  3. Verify that log entries with a single attribution value display as before.
  4. Verify that log entries with multiple teams, customers, or business units show the first value and a +N more indicator.
  5. Hover over a multi-value cell and confirm the tooltip lists all values.

Screenshots/Recordings

Add before/after screenshots of the attribution columns showing single vs. multi-value rendering.

Breaking changes

  • Yes
  • No

Related issues

Security considerations

None. No auth, secrets, or PII handling changes introduced.

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

impoiler commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: bde56b12-2f81-4f7b-ac3b-8fc47fc2a44d

📥 Commits

Reviewing files that changed from the base of the PR and between 995af61 and b9f6c9d.

📒 Files selected for processing (2)
  • ui/app/workspace/logs/views/columns.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/app/workspace/logs/views/columns.tsx

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Workspace log attribution now surfaces richer, human-readable names when available, automatically falling back through other available fields.
    • Longer attribution values can display multiple entries with a clear “+{n} more” indicator for additional items.
  • Bug Fixes

    • Improved rendering consistency for log details so related names appear more reliably across attribution columns.
    • Refined layout for log actions and realtime message display without changing behavior.

Walkthrough

Refactors log table attribution rendering to use an AttributionCell that can display multiple resolved values with truncation and a +N more indicator, updates attribution columns to pass name/id variants, and adds resolved name fields to LogEntry.

Changes

Attribution Cell Refactor

Layer / File(s) Summary
LogEntry type additions
ui/lib/types/logs.ts
Adds optional virtual_key_name and routing_rule_name fields to LogEntry.
AttributionCell component and wiring
ui/app/workspace/logs/views/columns.tsx
Adds MAX_ATTRIBUTION_LINES and AttributionCell with plural-first fallback across names/ids, truncated rendering with "+N more"; rewires attribution columns to use it; includes minor import, conditional, and actions-cell formatting updates.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: multi-value attribution cells with plural fallback in logs columns.
Description check ✅ Passed The PR description covers the required sections and includes summary, changes, type, affected areas, testing, and UI notes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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 07-02-fix_extra_column_accessors_for_logs_table

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

@impoiler
impoiler force-pushed the 07-02-fix_extra_column_accessors_for_logs_table branch from b885c80 to 2452cf2 Compare July 2, 2026 18:32
@impoiler
impoiler force-pushed the 07-02-fix_extra_column_accessors_for_logs_table branch from 2452cf2 to 995af61 Compare July 2, 2026 18:35
@impoiler impoiler self-assigned this Jul 2, 2026
@impoiler impoiler changed the title fix: extra column accessors for logs table feat: add multi-value attribution cell with plural fallback for logs columns Jul 2, 2026
@impoiler
impoiler marked this pull request as ready for review July 2, 2026 18:41
@coderabbitai
coderabbitai Bot requested a review from akshaydeo July 2, 2026 18:42
@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

This PR is safe to merge — it adds a well-scoped UI component with a correct fallback chain and no changes to backend logic or data contracts.

The change is purely additive: a new AttributionCell component replaces a simple inline helper, plural array fields that already existed on LogEntry are wired in, and two new optional top-level fields are added to the type. The fallback resolution logic is straightforward and handles all null/undefined/empty-array edge cases correctly. No data-testid attributes were removed and no security-sensitive code was touched.

No files require special attention.

Important Files Changed

Filename Overview
ui/app/workspace/logs/views/columns.tsx Replaces inline attributionCell helper with a new AttributionCell component supporting plural arrays and "+N more" overflow. Logic, fallback chain, and column wiring are all correct.
ui/lib/types/logs.ts Adds virtual_key_name and routing_rule_name as optional top-level fields alongside the already-present plural array fields (team_ids, team_names, etc.).

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["AttributionCell receives\nnames, name, ids, id"] --> B{"names array\nnon-empty?"}
    B -- Yes --> E["values = names.filter(Boolean)"]
    B -- No --> C{"name\npresent?"}
    C -- Yes --> F["values = [name]"]
    C -- No --> D{"ids array\nnon-empty?"}
    D -- Yes --> G["values = ids.filter(Boolean)"]
    D -- No --> H{"id\npresent?"}
    H -- Yes --> I["values = [id]"]
    H -- No --> J["Render '-'"]
    E --> K["visible = values[0..MAX_ATTRIBUTION_LINES]"]
    F --> K
    G --> K
    I --> K
    K --> L["Render visible values"]
    L --> M{"remaining > 0?"}
    M -- Yes --> N["Render '+N more'\nwith title tooltip for all values"]
    M -- No --> O["Render only visible values\nwith title tooltip"]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["AttributionCell receives\nnames, name, ids, id"] --> B{"names array\nnon-empty?"}
    B -- Yes --> E["values = names.filter(Boolean)"]
    B -- No --> C{"name\npresent?"}
    C -- Yes --> F["values = [name]"]
    C -- No --> D{"ids array\nnon-empty?"}
    D -- Yes --> G["values = ids.filter(Boolean)"]
    D -- No --> H{"id\npresent?"}
    H -- Yes --> I["values = [id]"]
    H -- No --> J["Render '-'"]
    E --> K["visible = values[0..MAX_ATTRIBUTION_LINES]"]
    F --> K
    G --> K
    I --> K
    K --> L["Render visible values"]
    L --> M{"remaining > 0?"}
    M -- Yes --> N["Render '+N more'\nwith title tooltip for all values"]
    M -- No --> O["Render only visible values\nwith title tooltip"]
Loading

Reviews (2): Last reviewed commit: "fix: extra column accessors for logs tab..." | Re-trigger Greptile

Comment thread ui/app/workspace/logs/views/columns.tsx

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
ui/app/workspace/logs/views/columns.tsx (2)

208-247: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use value as list key instead of array index.

visible.map((value, index) => <span key={index}> uses the array index as key. MAX_ATTRIBUTION_LINES is currently 1 so this is a no-op today, but as soon as the cap is raised the index-based key becomes fragile if the underlying array order changes (re-sorted, filtered, etc.). Prefer the value itself (or value-index composite if duplicates are possible) as key.

As per coding guidelines: "Always use stable, unique keys in lists; never use array index as key (unless unavoidable)."

♻️ Proposed fix
 			{visible.map((value, index) => (
-				<span key={index} className="truncate">
+				<span key={`${value}-${index}`} className="truncate">
 					{value}
 				</span>
 			))}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/app/workspace/logs/views/columns.tsx` around lines 208 - 247, The
AttributionCell list rendering uses an unstable array index key in the
visible.map loop. Update the key to a stable identifier based on the rendered
value in AttributionCell, using the value itself or a value-index composite if
duplicates are possible, so the span keys remain consistent if
MAX_ATTRIBUTION_LINES changes or the values order is updated.

Source: Coding guidelines


237-244: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Native title tooltip is inconsistent with the existing Radix Tooltip convention used for the same "+N more" pattern elsewhere.

modelCatalogTable.tsx implements the identical multi-value truncation UX using Tooltip/TooltipTrigger/TooltipContent (see relevant snippet), giving keyboard/focus accessibility and richer content rendering. Here, the full list is instead exposed only via the native title attribute on the wrapping div, which is not keyboard-accessible and has inconsistent styling/delay across browsers.

As per path instructions: "reuse existing constants, page structure, shared components, and data-testid naming patterns before introducing one-off UI conventions."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/app/workspace/logs/views/columns.tsx` around lines 237 - 244, The
multi-value column renderer in columns.tsx is using a native title attribute for
the full list, which is inconsistent with the existing Radix Tooltip pattern
used for the same “+N more” UX elsewhere. Update the component that renders the
visible values and remaining count to wrap the content with Tooltip,
TooltipTrigger, and TooltipContent like the approach in modelCatalogTable.tsx,
so the full list is shown through the shared tooltip convention instead of the
div title. Keep the existing truncation and “+{remaining} more” display, but
move the full values into the tooltip content for consistent accessibility and
styling.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@ui/app/workspace/logs/views/columns.tsx`:
- Around line 208-247: The AttributionCell list rendering uses an unstable array
index key in the visible.map loop. Update the key to a stable identifier based
on the rendered value in AttributionCell, using the value itself or a
value-index composite if duplicates are possible, so the span keys remain
consistent if MAX_ATTRIBUTION_LINES changes or the values order is updated.
- Around line 237-244: The multi-value column renderer in columns.tsx is using a
native title attribute for the full list, which is inconsistent with the
existing Radix Tooltip pattern used for the same “+N more” UX elsewhere. Update
the component that renders the visible values and remaining count to wrap the
content with Tooltip, TooltipTrigger, and TooltipContent like the approach in
modelCatalogTable.tsx, so the full list is shown through the shared tooltip
convention instead of the div title. Keep the existing truncation and
“+{remaining} more” display, but move the full values into the tooltip content
for consistent accessibility and styling.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c97b78cd-beb4-422a-a0fa-5170bac1fd97

📥 Commits

Reviewing files that changed from the base of the PR and between 97c8a21 and 995af61.

📒 Files selected for processing (2)
  • ui/app/workspace/logs/views/columns.tsx
  • ui/lib/types/logs.ts

@impoiler
impoiler force-pushed the 07-02-fix_extra_column_accessors_for_logs_table branch from 995af61 to b9f6c9d Compare July 3, 2026 04:29

akshaydeo commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • Jul 3, 4:34 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 3, 4:35 AM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo
akshaydeo merged commit 09bf6a3 into dev Jul 3, 2026
15 checks passed
@akshaydeo
akshaydeo deleted the 07-02-fix_extra_column_accessors_for_logs_table branch July 3, 2026 04:35
yangtuooc added a commit to yangtuooc/bifrost that referenced this pull request Jul 3, 2026
* upstream/dev:
  feat: adds multiple teams / customers / bus to connectors (maximhq#4875)
  fix: small latency return fixes (maximhq#4876)
  Added missing OpenAI responses methods for lifecycle related tasks (maximhq#3125)
  feat: latency info on errors (maximhq#4867)
  feat: add `user_name`, `team_ids`, `team_names`, `customer_ids`, `customer_names`, `business_unit_ids`, `business_unit_names` to log list select columns (maximhq#4866)
  feat: add multi-value attribution cell with plural fallback for logs columns (maximhq#4865)
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.

2 participants