diff options
| author | adamdottv <[email protected]> | 2025-05-28 15:36:31 -0500 |
|---|---|---|
| committer | adamdottv <[email protected]> | 2025-05-28 15:36:36 -0500 |
| commit | 9d7c5efb9b0b60c62aef3777b65b458a31ebbc88 (patch) | |
| tree | 0f5acb5b8093d872b30178ded53df719be40cf44 /cmd/root.go | |
| parent | 8863a499a9e311a48d6ab8bc05d267fb2a01f060 (diff) | |
| download | opencode-9d7c5efb9b0b60c62aef3777b65b458a31ebbc88.tar.gz opencode-9d7c5efb9b0b60c62aef3777b65b458a31ebbc88.zip | |
wip: refactoring tui
Diffstat (limited to 'cmd/root.go')
| -rw-r--r-- | cmd/root.go | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/cmd/root.go b/cmd/root.go index 685e0ca16..ccee60d39 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -13,35 +13,15 @@ import ( tea "github.com/charmbracelet/bubbletea" zone "github.com/lrstanley/bubblezone" "github.com/spf13/cobra" - "github.com/sst/opencode/internal/app" "github.com/sst/opencode/internal/config" "github.com/sst/opencode/internal/logging" "github.com/sst/opencode/internal/lsp/discovery" "github.com/sst/opencode/internal/pubsub" "github.com/sst/opencode/internal/tui" + "github.com/sst/opencode/internal/tui/app" "github.com/sst/opencode/internal/version" ) -type SessionIDHandler struct { - slog.Handler - app *app.App -} - -func (h *SessionIDHandler) Handle(ctx context.Context, r slog.Record) error { - if h.app != nil { - sessionID := h.app.CurrentSession.ID - if sessionID != "" { - r.AddAttrs(slog.String("session_id", sessionID)) - } - } - return h.Handler.Handle(ctx, r) -} - -func (h *SessionIDHandler) WithApp(app *app.App) *SessionIDHandler { - h.app = app - return h -} - var rootCmd = &cobra.Command{ Use: "OpenCode", Short: "A terminal AI assistant for software development", @@ -244,10 +224,6 @@ func setupSubscriptions(app *app.App, parentCtx context.Context) (chan tea.Msg, wg := sync.WaitGroup{} ctx, cancel := context.WithCancel(parentCtx) // Inherit from parent context - // setupSubscriber(ctx, &wg, "logging", app.Logs.Subscribe, ch) - // setupSubscriber(ctx, &wg, "sessions", app.Sessions.Subscribe, ch) - // setupSubscriber(ctx, &wg, "messages", app.Messages.Subscribe, ch) - // setupSubscriber(ctx, &wg, "permissions", app.Permissions.Subscribe, ch) setupSubscriber(ctx, &wg, "status", app.Status.Subscribe, ch) cleanupFunc := func() { |
