feat: add a compact job list view to the Jobs tab
Each job can now render as a single line — name on the left, status on the
right — instead of the three-line block, so many more jobs fit without
scrolling. A toggle button beside the Folder filter switches between the two
modes and is labelled with the action it performs, matching the existing
"Disable auto" convention.
The choice is persisted as Config.JobListView ("detailed" / "compact", stored
as job_list_view in gosentry.json). Empty, legacy, and unrecognised values all
normalize to detailed, so existing installs keep the current look and the file
never gains a value no reader understands.
Selection, the details panel, the folder filter, and live status updates work
unchanged in both modes.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -193,6 +193,27 @@ func (s *Service) SetGlobalPause(paused bool) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetJobListView persists the Jobs list density preference. Unlike
|
||||
// SetGlobalPause this touches nothing but the config: no job changed, so there
|
||||
// is no SaveJobs, and no event is emitted — the choice is presentational and the
|
||||
// Jobs view refreshes its own list, whereas an event would trigger a pointless
|
||||
// whole-window refresh. Anything that is not "compact" is stored as detailed so
|
||||
// the file never gains an unrecognised value.
|
||||
func (s *Service) SetJobListView(view domain.JobListView) error {
|
||||
if !view.IsCompact() {
|
||||
view = domain.JobListViewDetailed
|
||||
}
|
||||
s.mu.Lock()
|
||||
if s.store.Config.JobListView == view {
|
||||
s.mu.Unlock()
|
||||
return nil
|
||||
}
|
||||
s.store.Config.JobListView = view
|
||||
err := s.store.SaveConfig()
|
||||
s.mu.Unlock()
|
||||
return err
|
||||
}
|
||||
|
||||
// ShouldNotifyOnFailure reports whether the user has enabled desktop
|
||||
// notifications for failed job runs. It reads the config under mu so it is
|
||||
// safe to call from any goroutine.
|
||||
|
||||
Reference in New Issue
Block a user