Compare commits

..

2 Commits

Author SHA1 Message Date
mixeme 0f27d75359 ui/jobs_view: render job logs as compact one-line entries (T1.2)
Switch the jobLogs list template to TextTruncate wrapping and use
EventLine (base log filename only) instead of EventText so each
activity row stays on a single line in the jobs panel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 07:50:03 +03:00
mixeme 8fc28f592d app/format: add EventLine compact formatter (T1.1)
Uses filepath.Base for the log file so the jobs log view can show
one-line entries without the full directory path cluttering the row.
EventText is kept intact for the History table.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-24 07:49:26 +03:00
2 changed files with 20 additions and 2 deletions
+14
View File
@@ -2,6 +2,7 @@ package app
import ( import (
"fmt" "fmt"
"path/filepath"
"strings" "strings"
"gitea.mixdep.ru/mix/gosentry/src/domain" "gitea.mixdep.ru/mix/gosentry/src/domain"
@@ -32,6 +33,19 @@ func EventText(e domain.RunRecord) string {
return fmt.Sprintf("%s %s %s %s %s", e.Time, trigger, e.JobName, e.State, e.Detail) return fmt.Sprintf("%s %s %s %s %s", e.Time, trigger, e.JobName, e.State, e.Detail)
} }
// EventLine formats a run record as a compact single line for the jobs log
// view, using only the base name of the log file instead of the full path.
func EventLine(e domain.RunRecord) string {
trigger := e.Trigger
if trigger == "" {
trigger = "Unknown"
}
if e.LogFile != "" {
return fmt.Sprintf("%s %s %s %s %s %s", e.Time, trigger, e.JobName, e.State, e.Detail, filepath.Base(e.LogFile))
}
return fmt.Sprintf("%s %s %s %s %s", e.Time, trigger, e.JobName, e.State, e.Detail)
}
// DisplayFolder formats a job's folder for display: "(No folder)" if empty, // DisplayFolder formats a job's folder for display: "(No folder)" if empty,
// else the trimmed folder name. // else the trimmed folder name.
func DisplayFolder(folder string) string { func DisplayFolder(folder string) string {
+6 -2
View File
@@ -77,9 +77,13 @@ func newJobsView(w fyne.Window, svc *app.Service) (fyne.CanvasObject, func()) {
selectedLogs := append([]event(nil), selectedRuntime.Logs...) selectedLogs := append([]event(nil), selectedRuntime.Logs...)
jobLogs := widget.NewList( jobLogs := widget.NewList(
func() int { return len(selectedLogs) }, func() int { return len(selectedLogs) },
func() fyne.CanvasObject { return widget.NewLabel("log") }, func() fyne.CanvasObject {
l := widget.NewLabel("log")
l.Wrapping = fyne.TextTruncate
return l
},
func(id widget.ListItemID, item fyne.CanvasObject) { func(id widget.ListItemID, item fyne.CanvasObject) {
item.(*widget.Label).SetText(app.EventText(selectedLogs[id])) item.(*widget.Label).SetText(app.EventLine(selectedLogs[id]))
}, },
) )