1.9 KiB
1.9 KiB
072 — Log Preview needs a format column (ottyl_fmt)
Summary
Wishlist feedback: "Log preview needs format column." ottyl_fmt
(json/logfmt/none, crate::logfmt::detect_format) already exists as a
reserved, filterable pseudo-param (OTTYL_RESERVED_PARAM_NAMES,
src/engine.rs:1960; filter-bar support via
compile_ottyl_fmt_comparison, src/engine.rs:1067) — you can already
filter ottyl_fmt==json in the search bar. But it isn't surfaced as a
visible column in the Log Preview table
(webapp/src/components/LogPreview.tsx), and it can't be, because
LogEntryDto (src/dto.rs:10-16) doesn't include it: params only
holds declared ParamDeclaration matches, and format detection is
computed line-locally elsewhere, never attached to the returned log
entry.
Scope
- Add the per-line detected format to
LogEntryDto(src/dto.rs:10), populated wherever log entries are assembled for theLogsquery response inengine.rs(reusecrate::logfmt::detect_format, the same detectionottyl_fmtfiltering already calls). - Add
ottyl_fmtas a column option in Log Preview'sColumnPicker(webapp/src/components/LogPreview.tsx:28-56) alongside declared params — it's a reserved pseudo-param likeottyl_seq/ottyl_ts, so treat it the way the params list already flagsreserved(dto.rs:38,ParamDeclarationDto.reserved) rather than requiring it be "declared" to show up as a pickable column. - Render the column value as the short format label (
json/logfmt/none) matching whatottyl_fmtfilter comparisons already produce.
Acceptance criteria
- A "Format" (or
ottyl_fmt) column is available in the Log Preview's column picker and, once toggled on, shows the correct detected format per row — json lines showjson, logfmt lines showlogfmt, neither showsnone. - No change to filter-bar
ottyl_fmtcomparison behavior (still works as before).
Depends on
None.