Skip to content

feat(log-viewer): give the inspector's empty state per-source copy - #891

Merged
lcottercertinia merged 3 commits into
certinia:mainfrom
lukecotter:feat-inspector-empty-states
Aug 1, 2026
Merged

feat(log-viewer): give the inspector's empty state per-source copy#891
lcottercertinia merged 3 commits into
certinia:mainfrom
lukecotter:feat-inspector-empty-states

Conversation

@lukecotter

Copy link
Copy Markdown
Collaborator

Closes #25.

The Inspector rendered one hardcoded emptyText="Select a row to inspect it." regardless of which tab was active, so a user on the timeline was told to select a "row".

detailSections.ts now owns an EMPTY_TEXT map keyed by DetailSource and exports emptyTextFor(source), which LogInspector renders for the active source. Copy names what to click per tab (frame on the timeline / frame in the call tree / row in the analysis grid / SOQL, DML or SOSL row). An undefined source falls back to the old generic string.

One mechanism, not two — the null-selection branch of buildDetailSections still returns [] unchanged; only the placeholder text is source-aware.

Precedence rule

This is the module that decides what "nothing selected" means, so the rule is documented here for #26 to inherit rather than re-decide: an explicit row/frame selection always wins. A range or other ambient scope only applies when selection is null, and must be layered into that branch — never made to override an explicit selection.

Tests

  • detailSections.test.ts — the null-selection test loops all four sources; new emptyTextFor describe block covers each source plus the fallback.
  • LogInspector.test.ts — steps through all four tabs and asserts the rendered placeholder changes.

Not in scope

DMLView/SOQLView/SOSLView never emit selection: null on deselect, so the database tab can't currently reach its own empty state by deselecting. That's an emission gap in three separate views rather than part of this seam — filed separately.

`detailSections.ts` imports the section builders' web components, so tests that
touch it must mock the whole module — which forced `LogInspector.test.ts` to
hand-mirror the four empty-state strings in its mock factory. The copy could
then drift from the real thing with the test still passing.

`detailEmptyText.ts` holds `emptyTextFor` with a type-only import, so consumers
and their tests reach the real copy without pulling in Tabulator. The mirror and
the `emptyTextFor` mock entry are gone, and its tests move to their own suite.
@lukecotter

Copy link
Copy Markdown
Collaborator Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

lcottercertinia
lcottercertinia previously approved these changes Aug 1, 2026
…y-states

# Conflicts:
#	log-viewer/src/components/__tests__/LogInspector.test.ts
@lcottercertinia
lcottercertinia merged commit 8e0b96c into certinia:main Aug 1, 2026
7 checks passed
@lukecotter
lukecotter deleted the feat-inspector-empty-states branch August 1, 2026 19:03
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.

Add ability to export 'Analysis' to CSV

2 participants