Skip to content

Commit dbf4ef8

Browse files
committed
fix: update TUI description when job is started or created from gobfile
When the TUI opens and a job already exists without a description, the description from gobfile was not being displayed. This was caused by: 1. EventTypeJobStarted handler not copying description from the event 2. CreateJob not emitting EventTypeJobUpdated when description changes
1 parent 96a0d18 commit dbf4ef8

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Fixed
1111

1212
- **Runs panel column misalignment**: Fixed status column padding using byte length instead of visual width, causing misaligned columns when Unicode status icons (✓, ◉, ◼) were displayed.
13+
- **Gobfile descriptions not displayed**: Fixed job descriptions from gobfile not appearing in TUI when job already existed without a description.
1314

1415
## [3.0.0-rc.2] - 2026-01-25
1516

internal/daemon/job.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,14 @@ func (jm *JobManager) CreateJob(command []string, workdir string, description st
446446
Logger.Warn("failed to update job description", "id", job.ID, "error", err)
447447
}
448448
}
449+
// Emit event for description change
450+
jm.emitEvent(Event{
451+
Type: EventTypeJobUpdated,
452+
JobID: job.ID,
453+
Job: jm.jobToResponse(job),
454+
JobCount: len(jm.jobs),
455+
RunningJobCount: jm.countRunningJobsLocked(),
456+
})
449457
}
450458

451459
return job, nil

internal/tui/tui.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ func (m *Model) handleDaemonEvent(event daemon.Event) {
558558
m.jobs[i].PID = event.Job.PID
559559
m.jobs[i].StartedAt = parseTime(event.Job.StartedAt)
560560
m.jobs[i].StoppedAt = time.Time{}
561+
m.jobs[i].Description = event.Job.Description
561562

562563
// Move job to the top of the list (most recently run first)
563564
if i > 0 {

0 commit comments

Comments
 (0)