charmbracelet / charmbracelet/bubbletea

Each view in its own package ...

Open
#1,593 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
44.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

my app would have multiple phase i created diff [structs inside model](https://github.com/devnchill/AiCli/blob/refactor/internal/tui/model.go#L47) and use that depending on current phase field of model struct.

now issue is if i create separate package for each phase,how would they modify model struct ?

because, for that i would need to import `tui` package where `model` lives ,and `tui` package would have to import my diff `phase` package to call their respective *update* and *view* functions eventually creating dependency cycle...

Examples don't go through any situation where i would like to have separate views in separate package,putting every phase in same package would make it messy hence I would like to keep it separate

Contributor guide

Open the contributing guide

Research direction

Start by reading internal/tui/model.go around line 47 and tracing how the current phase-specific structs are used by the model's update and view flow. Compare that structure with Bubble Tea's package and model boundaries, then determine whether separate phase packages can be organized without an import cycle. Done means a concrete, agreed package design or documented guidance for this architecture question.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.