Skip to content

feat: implement header component for improved branding in TUI - #1294

Open
Soner (shyim) wants to merge 1 commit into
nextfrom
feat/header-component
Open

feat: implement header component for improved branding in TUI#1294
Soner (shyim) wants to merge 1 commit into
nextfrom
feat/header-component

Conversation

@shyim

Copy link
Copy Markdown
Member

Move header into own component for easier adding things

Comment thread internal/tui/header.go
}

// NewHeader creates the shared branding header.
func NewHeader() Header {

@shyim Soner (shyim) Jul 30, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anne (@Ant1gua) the idea here would be now to accept an ctx and do something like this

type LatestVersionMsg struct{ Version string }

func NewHeader(ctx ) Header {
  h := Header{}
  h.fetchLatest = func() tea.Msg {
        ctx, cancel := context.WithTimeout(ctx, time.Second)
        defer cancel()

        latest, err := fetchLatestRelease(ctx)
        if err != nil {
            return nil
        }
        return LatestVersionMsg{Version: latest}
    }
}

func (h Header) Init() tea.Cmd {
    return h.fetchLatest
}

func (h Header) Update(msg tea.Msg) (Header, tea.Cmd) {
    if msg, ok := msg.(LatestVersionMsg); ok && newerThanApp(msg.Version) {
        // Adjust h to add the latest version
    }
    return h, nil
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants