Skip to content

Show a record's full text in the evidence table - #2518

Merged
dzarlax merged 5 commits into
constructorfabric:mainfrom
dzarlax:feat/evidence-full-record
Aug 14, 2026
Merged

Show a record's full text in the evidence table#2518
dzarlax merged 5 commits into
constructorfabric:mainfrom
dzarlax:feat/evidence-full-record

Conversation

@dzarlax

@dzarlax dzarlax commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #2514.

What was actually wrong

The title column does not carry a title. It carries a git commit's whole
message — a subject, a blank line, then a body. A single-line cell collapses
that into one run of words and cuts it a few words in, so what reads as a
truncated title is a subject with its body jammed onto the end.

Measured against a running instance, one sample of eleven commit records:

characters lines first line
median 364 8 57
longest 1565 33 72

First lines were 32-100 characters. So no column width fixes this: a
thousand-character message will not fit a cell, and wrapping it would make one
row taller than the whole dialog.

What changed

The cell shows the subject. Everything up to the first newline. That alone
removes most of the visible truncation, because subjects are short.

A row expands to the full record. Every field, in full, with line breaks
intact, in a panel below the row. Expansion is keyed on the record rather than
its position, so re-sorting leaves the open record open instead of handing the
open state to whatever now sits in that slot. Row heights are measured, since
an expanded record is as tall as its message needs.

Width was rebalanced. Columns holding a number or a date no longer grow — a
wider column shows no more of a six-digit figure — and a numeric heading wraps
to two lines rather than claiming width the title has better use for. The title
column gains about a third more room.

The expander is offered on every row, not only rows with a long field: the
panel is a full-record view, useful for reading and copying any field without
scrolling the table sideways, and a control that appears only sometimes is
harder to find than one that is always there.

Verification

  • pnpm typecheck, eslint, vitest run --project unit (1210 passing)
  • Exercised against a running instance: with a row expanded, measured row
    heights sum exactly to the body height with no overlap, and the tallest row
    measured to fit its message. Re-sorting kept the same record open. No column
    header or cell clips any more, except the title, which is what expansion is
    for.

Summary by CodeRabbit

  • New Features

    • Added expandable evidence table rows with full-record detail panels.
    • Added row toggling, copy interactions, tooltips, and clearer multiline summaries.
    • Preserved expanded-row state reliably while sorting and virtualizing results.
    • Improved column sizing, header wrapping, and accessibility announcements.
  • Bug Fixes

    • Reset table expansion state when switching metrics.
    • Improved handling of duplicate records, missing values, scrolling, and row measurements.

The title column carries a git commit's whole message — a subject, a blank
line, then a body that can run to dozens of lines. A single-line cell
collapsed all of it into one run of words and cut it a few words in, so what
read as a truncated title was really a subject with its body jammed onto the
end. No column width fixes that: the longest message in a sample ran past a
thousand characters, and wrapping it would make one row taller than the
dialog.

The cell now shows the subject alone, and a row expands to a panel holding
every field in full with its line breaks intact. Expansion is keyed on the
record rather than its position, so a re-sort leaves the open record open.

Width was rebalanced to suit: columns holding a number or a date no longer
grow, since a wider column shows no more of a six-digit figure, and a numeric
heading wraps rather than claiming width the title has better use for.

Signed-off-by: Alexey Panfilov <alexey.panfilov@constructor.tech>
@dzarlax
dzarlax requested a review from a team as a code owner August 13, 2026 14:32
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The metric evidence table now shows first-line summaries, stable row identities, expandable full-record details, dynamic virtualized heights, and isolated copy interactions. The dialog resets expansion state when the active metric changes.

Changes

Metric evidence expansion

Layer / File(s) Summary
Stable evidence identity and summaries
src/frontend/src/lib/metrics/evidence-rows.ts, src/frontend/src/lib/metrics/evidence-rows.test.ts
Added multiline summary extraction and deterministic, duplicate-safe row keys with tests for ordering, repositories, duplicates, and field order.
Expandable virtualized evidence table
src/frontend/src/components/metric-evidence-table.tsx, src/frontend/src/components/metric-evidence-table.test.tsx
Added row expansion, full-record detail panels, stable virtualization keys, dynamic measurement, wrapped headers, summarized cells, and interaction tests.
Metric-scoped expansion reset
src/frontend/src/components/metric-evidence-dialog.tsx
The table remounts when the active metric changes, which clears expansion state.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to a5e8d

The PR changes how full record text is displayed and expanded without any supplied evidence of an actionable merge-blocking risk; it is merge-ready after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant MetricEvidenceTable
  participant evidenceRowKeys
  participant summaryLine
  participant Virtualizer
  MetricEvidenceTable->>evidenceRowKeys: Generate stable row keys
  MetricEvidenceTable->>summaryLine: Summarize multiline values
  MetricEvidenceTable->>Virtualizer: Render and measure rows
  MetricEvidenceTable->>MetricEvidenceTable: Toggle expanded record
  MetricEvidenceTable->>Virtualizer: Re-measure expanded detail panel
Loading

Possibly related PRs

Suggested reviewers: aleksdotbar

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: showing a record's full text in the evidence table through expandable rows.
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 unit tests (beta)
  • Create PR with unit tests

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

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

Alexey Panfilov and others added 4 commits August 13, 2026 16:38
Expansion was reachable only from a chevron a couple of characters wide at
the far left, so clicking the text that is visibly cut did nothing. The whole
row now toggles, and shows a pointer. The chevron stays as the control a
keyboard and a screen reader use; the copy button stops the click from
reaching the row.

The hover text on a cell drops to the line the cell shows. It had been the
whole field, which for a commit message is a thousand characters in a native
tooltip — the expanded row is where that belongs.

Signed-off-by: Alexey Panfilov <alexey.panfilov@constructor.tech>
…ce table

Three defects a review found in the expandable row, each reproduced:

The virtualizer cached a measured height under the row's index while React
keyed the row by its identity, so a re-sort or a search keystroke left a tall
measurement on whatever row inherited the position. It now measures under the
same key.

`ref` is a PR or issue number, unique only within a repository, so two records
could share a key and expand together. Identity is now the whole value set,
with an occurrence suffix for rows that match to the last field.

A click inside the open panel bubbled to the row and closed it, so the text
the panel exists to show could not be selected.

Also: the row carries `aria-expanded` and the panel spans the columns, so the
grid reads correctly; switching metric no longer inherits the previous one's
expansion; and `summaryLine` skips leading blank lines rather than rendering
an empty cell.

Signed-off-by: Alexey Panfilov <alexey.panfilov@constructor.tech>
A long commit message made one row taller than the table, so reading a single
record meant scrolling a list. The panel now scrolls inside itself, and the cap
is a fixed height rather than a viewport fraction — vh is the window, which can
exceed the table's own height and leave the record filling it anyway.

Signed-off-by: Alexey Panfilov <alexey.panfilov@constructor.tech>
@dzarlax
dzarlax enabled auto-merge August 14, 2026 07:31

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔇 Additional comments (5)
src/frontend/src/lib/metrics/evidence-rows.ts (1)

27-52: LGTM!

src/frontend/src/lib/metrics/evidence-rows.test.ts (1)

6-8: LGTM!

Also applies to: 132-186

src/frontend/src/components/metric-evidence-table.tsx (1)

1-11: LGTM!

Also applies to: 28-47, 79-82, 119-144, 186-192, 225-234, 250-343

src/frontend/src/components/metric-evidence-table.test.tsx (1)

9-9: LGTM!

Also applies to: 20-20, 60-60, 73-104, 116-276

src/frontend/src/components/metric-evidence-dialog.tsx (1)

341-344: 📐 Maintainability & Code Quality

⚠️ Unverified finding
Sandbox verification was unavailable.

Verify coverage for the metric-change remount path.

Add or confirm a test that expands a record, changes the active metric, and verifies that the replacement table starts collapsed. The supplied context does not establish coverage for this path. Confirm that changed lines meet the required 80% coverage threshold. As per coding guidelines, “Ensure new and changed lines achieve at least 80% test coverage.”


ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a9ef0a7b-6fee-419f-94e0-84d6a87249f6

📥 Commits

Reviewing files that changed from the base of the PR and between ce99a4b and a5e8d39.

📒 Files selected for processing (5)
  • src/frontend/src/components/metric-evidence-dialog.tsx
  • src/frontend/src/components/metric-evidence-table.test.tsx
  • src/frontend/src/components/metric-evidence-table.tsx
  • src/frontend/src/lib/metrics/evidence-rows.test.ts
  • src/frontend/src/lib/metrics/evidence-rows.ts

@dzarlax
dzarlax added this pull request to the merge queue Aug 14, 2026
Merged via the queue into constructorfabric:main with commit 02fe957 Aug 14, 2026
54 checks passed
@dzarlax
dzarlax deleted the feat/evidence-full-record branch August 14, 2026 07:42
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