fix(daemon): defer floating activation wiring
- commit
- f1db0f5a0c7d082809bc7b4ba2e0678c578911ca
- author
- brice · · 2026-07-10 00:22 UTC
- committer
- brice · · 2026-07-10 05:40 UTC
- parent
- 0fef5f3
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +6 -4
M internal/usecase/daemon/client.go +0 -3
| @@ -398,9 +398,6 @@ func (d *Daemon) attachClient(sess *session, tr ports.Transport, sz domain.Size, | |||
| 398 | 398 | d.touchMRU(sess) | |
| 399 | 399 | d.log.Info("client attached", "session", name, "resume", opts.resumeCapable) | |
| 400 | 400 | d.applyHostTheme(sess, ac, d.effectiveTheme(themeui.Theme{}), true) | |
| 401 | - | // A restored inactive tab remains cold; the attached active tab starts its | |
| 402 | - | // independent popup prewarm asynchronously. | |
| 403 | - | d.ensureFloatingWarm(sess, sess.activeTab()) | |
| 404 | 401 | return ac, old | |
| 405 | 402 | } | |
| 406 | 403 | ||
| @@ -398,9 +398,6 @@ func (d *Daemon) attachClient(sess *session, tr ports.Transport, sz domain.Size, | |||||
| 398 | d.touchMRU(sess) | 398 | d.touchMRU(sess) | ||
| 399 | d.log.Info("client attached", "session", name, "resume", opts.resumeCapable) | 399 | d.log.Info("client attached", "session", name, "resume", opts.resumeCapable) | ||
| 400 | d.applyHostTheme(sess, ac, d.effectiveTheme(themeui.Theme{}), true) | 400 | d.applyHostTheme(sess, ac, d.effectiveTheme(themeui.Theme{}), true) | ||
| 401 | - | // A restored inactive tab remains cold; the attached active tab starts its | |||
| 402 | - | // independent popup prewarm asynchronously. | |||
| 403 | - | d.ensureFloatingWarm(sess, sess.activeTab()) | |||
| 404 | return ac, old | 401 | return ac, old | ||
| 405 | } | 402 | } | ||
| 406 | 403 | ||||
M internal/usecase/daemon/snapshot_restore_test.go +6 -1
| @@ -112,9 +112,14 @@ func TestRestoreSnapshotsLeavesFloatingUninitializedAndInactiveTabsCold(t *testi | |||
| 112 | 112 | {Cols: 80, Rows: 24, Tree: layout.NewTree("pane-1"), Panes: []snapcodec.Pane{{ID: "pane-1", Cwd: "/two"}}}, | |
| 113 | 113 | }, | |
| 114 | 114 | })}}} | |
| 115 | - | d := newTestDaemon(t, &restorePTYFactory{}, stubClock{}) | |
| 115 | + | factory := &restorePTYFactory{} | |
| 116 | + | d := newTestDaemon(t, factory, stubClock{}) | |
| 117 | + | d.ApplyConfig(domain.Config{Floating: domain.FloatingConfig{Command: "btop", Width: 80, Height: 80}}) | |
| 116 | 118 | WithSnapshotStore(store)(d) | |
| 117 | 119 | d.restoreSnapshots(context.Background()) | |
| 120 | + | // Only the persisted normal panes may be restored. Floating runtimes are | |
| 121 | + | // deliberately excluded and must wait for a Phase-5 activation path. | |
| 122 | + | require.Len(t, factory.opens, 2) | |
| 118 | 123 | d.mu.Lock() | |
| 119 | 124 | restored := d.findByNameLocked("work") | |
| 120 | 125 | d.mu.Unlock() | |
| @@ -112,9 +112,14 @@ func TestRestoreSnapshotsLeavesFloatingUninitializedAndInactiveTabsCold(t *testi | |||||
| 112 | {Cols: 80, Rows: 24, Tree: layout.NewTree("pane-1"), Panes: []snapcodec.Pane{{ID: "pane-1", Cwd: "/two"}}}, | 112 | {Cols: 80, Rows: 24, Tree: layout.NewTree("pane-1"), Panes: []snapcodec.Pane{{ID: "pane-1", Cwd: "/two"}}}, | ||
| 113 | }, | 113 | }, | ||
| 114 | })}}} | 114 | })}}} | ||
| 115 | - | d := newTestDaemon(t, &restorePTYFactory{}, stubClock{}) | 115 | + | factory := &restorePTYFactory{} |
| 116 | + | d := newTestDaemon(t, factory, stubClock{}) | |||
| 117 | + | d.ApplyConfig(domain.Config{Floating: domain.FloatingConfig{Command: "btop", Width: 80, Height: 80}}) | |||
| 116 | WithSnapshotStore(store)(d) | 118 | WithSnapshotStore(store)(d) | ||
| 117 | d.restoreSnapshots(context.Background()) | 119 | d.restoreSnapshots(context.Background()) | ||
| 120 | + | // Only the persisted normal panes may be restored. Floating runtimes are | |||
| 121 | + | // deliberately excluded and must wait for a Phase-5 activation path. | |||
| 122 | + | require.Len(t, factory.opens, 2) | |||
| 118 | d.mu.Lock() | 123 | d.mu.Lock() | ||
| 119 | restored := d.findByNameLocked("work") | 124 | restored := d.findByNameLocked("work") | ||
| 120 | d.mu.Unlock() | 125 | d.mu.Unlock() | ||