feat(viewer): show result type and length in the status line#120
Open
laurigates wants to merge 1 commit into
Open
feat(viewer): show result type and length in the status line#120laurigates wants to merge 1 commit into
laurigates wants to merge 1 commit into
Conversation
After each query the status line reports the current result's type and length — e.g. `result: object · 3 keys`, `array · 5 items`, `string · 12 chars`, or `stream · N values` — so users don't have to append `| type` / `| length` to inspect the shape of a result (ynqa#72). The summary is computed by a pure `json::summarize` helper (unit tested) and surfaced through the existing guide/status mechanism, so it requires no layout changes. It is shown on query success; null/error results keep their existing messages. Closes ynqa#72 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
|
Related PRs (no strict merge order) — #120, #121, and #122 are a small series of viewer / status-line improvements that independently edit the same code ( |
This was referenced Jun 25, 2026
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.
Summary
After each query, the status line now reports the type and length of the current result, so you don't have to append
| type/| lengthto inspect a result's shape (#72).Examples:
result: object · 3 keysresult: array · 5 itemsresult: string · 12 charsresult: number/boolean/nullresult: stream · N values(multi-value output)result: empty (0 results)Implementation
json::summarize(&[Value]) -> Stringhelper mirrors jq'stype/lengthsemantics; it's unit tested (objects/arrays/strings, scalars, streams, empty, and Unicode char counting).GuideMessage::ResultSummary) on the query-success path — no layout changes. Null and error results keep their existing messages.Scope note
This shows the summary in the existing status line, which updates on each query result (the moment the shape matters). The issue mentions a vim-style persistent corner/bottom line; that would need a new dedicated render slot and layout rework. Happy to follow up with a persistent statusline if you'd prefer that direction — kept this change minimal and self-contained.
Closes #72