Rework omni search onto a typed search contract and add a TUI artifacts view
Protocol: replace the loose Query/Kind/Matches/Limit search fields with a Search request object and a SearchResults response, and have the server answer search from Store.Search over the shared run projections (runFrom/runStamps).
CLI: add the read-only 'pipelines search QUERY [--type KIND] [--limit N] [--json]' command with usage/help, and document the typed targets, ranking and bounds in docs/cli.md.
TUI: the '/' popup keeps type-to-search, up/down, Enter and Esc, renders one ranked list with kind badges and a bracketed (non-colour) match snippet, and Enter opens the matched pipeline, run, step, artifact or field; footer text updated to match.
TUI: add a dedicated run artifacts view ('A') with open/copy of recorded files, and move artifacts out of the run-detail File changes section (artifactCaptureNotes).
Tests: add Store.OpenReadOnly for read-only inspection of a live database plus pipeline/server/TUI search tests and artifacts tests, including env-gated live checks.
This commit is contained in:
@@ -57,23 +57,22 @@ func humanBytes(size int64) string {
|
||||
return fmt.Sprintf("%.1f %ciB", float64(size)/float64(div), "KMGTPE"[exp])
|
||||
}
|
||||
|
||||
// artifactLines lists one step's recorded artifacts (name and size) for the
|
||||
// retained-evidence view, matching the file-changes style.
|
||||
func artifactLines(step protocol.RunStep) []string {
|
||||
// artifactCaptureNotes lists the partial-capture notes for one visit: one line
|
||||
// per non-zero excluded/omitted count, and nothing when the capture was
|
||||
// complete. A visit with no recorded artifacts yields no notes, mirroring the
|
||||
// app's artifactCaptureNotes, so notes never accompany an empty-state summary.
|
||||
func artifactCaptureNotes(step protocol.RunStep) []string {
|
||||
if len(step.Artifacts) == 0 {
|
||||
return nil
|
||||
}
|
||||
lines := []string{artifactsSummary(step)}
|
||||
for _, artifact := range step.Artifacts {
|
||||
lines = append(lines, fmt.Sprintf("%s · %s · %s", ansi.Strip(artifact.Name), humanBytes(artifact.SizeBytes), ansi.Strip(artifact.ContentType)))
|
||||
}
|
||||
var notes []string
|
||||
if step.ArtifactsSkipped > 0 {
|
||||
lines = append(lines, fmt.Sprintf("%d files excluded from artifact capture.", step.ArtifactsSkipped))
|
||||
notes = append(notes, fmt.Sprintf("%d files excluded from artifact capture.", step.ArtifactsSkipped))
|
||||
}
|
||||
if step.ArtifactsTruncated > 0 {
|
||||
lines = append(lines, fmt.Sprintf("%d files omitted by artifact capture limits.", step.ArtifactsTruncated))
|
||||
notes = append(notes, fmt.Sprintf("%d files omitted by artifact capture limits.", step.ArtifactsTruncated))
|
||||
}
|
||||
return lines
|
||||
return notes
|
||||
}
|
||||
|
||||
func diffHighlight(line string) string {
|
||||
|
||||
Reference in New Issue
Block a user