Revert "Every workspace split into real panes: 19 panes across 7 workspaces, one program per panel"
This reverts commit 32fa2752af.
This commit is contained in:
47
tui/work.go
47
tui/work.go
@@ -29,7 +29,6 @@ type workMsg struct {
|
||||
}
|
||||
|
||||
type workModel struct {
|
||||
panel string
|
||||
client *paperclip.Client
|
||||
folder string
|
||||
issue string
|
||||
@@ -53,8 +52,8 @@ type workModel struct {
|
||||
|
||||
var workTabs = []string{"runs", "change", "facts"}
|
||||
|
||||
func newWorkModel(c *paperclip.Client, folder, issueID, panel string) workModel {
|
||||
return workModel{client: c, folder: folder, issue: issueID, explicit: issueID != "", panel: panel}
|
||||
func newWorkModel(c *paperclip.Client, folder, issueID string) workModel {
|
||||
return workModel{client: c, folder: folder, issue: issueID, explicit: issueID != ""}
|
||||
}
|
||||
|
||||
func (m workModel) Init() tea.Cmd {
|
||||
@@ -188,49 +187,7 @@ func (m workModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// singleView is one panel filling the pane: runs, change or facts.
|
||||
func (m workModel) singleView() string {
|
||||
titles := map[string]string{"runs": "runs and activity", "change": "the change", "facts": "worktree facts"}
|
||||
title, ok := titles[m.panel]
|
||||
if !ok {
|
||||
title = "runs and activity"
|
||||
}
|
||||
var body []string
|
||||
switch m.panel {
|
||||
case "change":
|
||||
body = m.diffLines(m.width - 3)
|
||||
case "facts":
|
||||
body = m.factsLines(m.width - 3)
|
||||
default:
|
||||
body = m.runsLines(m.width - 3)
|
||||
}
|
||||
head := m.task.Identifier
|
||||
if head == "" {
|
||||
head = "no task chosen"
|
||||
}
|
||||
footer := hintLine([]string{
|
||||
keyHint("↑↓ j k", "scroll"),
|
||||
keyHint("g G", "top / bottom"),
|
||||
keyHint("r", "read again"),
|
||||
keyHint("R", "rebuild"),
|
||||
keyHint("?", "keys"),
|
||||
}, m.width)
|
||||
if m.showHelp {
|
||||
return helpOverlay(title, [][2]string{
|
||||
{"↑ ↓ j k", "scroll"}, {"g / G", "top / bottom"},
|
||||
{"r / R", "read again / rebuild"}, {"q", "leave"},
|
||||
}, m.width, m.height)
|
||||
}
|
||||
return singlePanel(title+" · "+head, nil, 0, body, m.width, m.height, footer, m.scroll)
|
||||
}
|
||||
|
||||
func (m workModel) View() string {
|
||||
if m.panel != "" {
|
||||
if m.width == 0 {
|
||||
return "reading…"
|
||||
}
|
||||
return m.singleView()
|
||||
}
|
||||
if m.width == 0 || m.height == 0 {
|
||||
return "reading…"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user