Files
zeekay 1b367e2b62 chore: rebase the tree onto upstream master
The tree was a debranded snapshot of upstream taken around 2026-02-20, and
upstream has moved about five months since. This replaces it with upstream
master, mechanically re-derived: bin/debrand does the rename, and the
pipeline and squashed migrations are restored from the shipped tree.

Not a merge. The previous import replaced the tree wholesale in a single
commit, so there is no shared content history to merge against. Reproducing
the rename on the new tree is what actually converges.

What survives: .hanzo/workflows, the Dockerfiles and bin/docker* entrypoints,
compose files, LLM.md, and insights/migrations. The squashed initial
migration is load-bearing — the live database records it by name, so
upstream's ~918 individual migrations cannot come back.

Nine products are dropped as unreferenced. Twenty-one more that we do not run
are kept anyway because the core app still imports them; unpicking those is a
refactor and does not belong in a rebase.

This base does not build yet, and the reasons are not in the rename:
upstream now wants Python 3.13.13 against our 3.12.12 and Django 5.2 against
our 4.2, and the dependency manifests still name upstream packages that we
republish under our own names. Those are decisions, not renames.
2026-08-01 15:44:40 -07:00

78 lines
2.5 KiB
Go

package tui
import tea "charm.land/bubbletea/v2"
func (m Model) handleMouseClick(msg tea.MouseClickMsg, cmds []tea.Cmd) (tea.Model, tea.Cmd) {
if msg.Button == tea.MouseLeft {
// Sidebar is from x=0 to x=sidebarWidth-1, content starts at y=headerHeight
if msg.X < sidebarWidth && msg.Y >= headerHeight {
m.focusedPane = focusServices
m.dbg("focus: mouse click → sidebar")
row := msg.Y - headerHeight - 1
// Decremented by 1 to account for the arrow taking up a row
canScrollUp, _, _ := m.sidebarScrollState()
if canScrollUp {
row--
}
idx := m.servicesOffset + row
if m.isGrouped() {
// In grouped mode, idx indexes into sidebarEntries
if idx >= 0 && idx < len(m.sidebarEntries) {
e := m.sidebarEntries[idx]
if e.isNonSelectable() {
// Click on group header or spacer — ignore
return m, tea.Batch(cmds...)
}
prev := m.servicesCursor
m.entryCursor = idx
m.servicesCursor = e.procIndex
m.ensureSidebarCursorVisible()
if prev != m.servicesCursor {
m.dbg("proc selected (mouse): %s", m.services[m.servicesCursor].Name)
var loadCmds []tea.Cmd
m, loadCmds = m.loadActiveProc()
return m, tea.Batch(loadCmds...)
}
}
} else if idx >= 0 && idx < len(m.services) {
prev := m.servicesCursor
m.servicesCursor = idx
m.ensureSidebarCursorVisible()
if prev != m.servicesCursor {
m.dbg("proc selected (mouse): %d→%d (%s)", prev, m.servicesCursor, m.services[m.servicesCursor].Name)
var loadCmds []tea.Cmd
m, loadCmds = m.loadActiveProc()
return m, tea.Batch(loadCmds...)
}
}
} else if m.isDockerMode() && msg.X >= m.width-containerSidebarWidth && msg.Y >= headerHeight {
// Clicked in container sidebar
m.focusedPane = focusContainers
m.dbg("focus: mouse click → containers")
row := msg.Y - headerHeight - 1
idx := m.containerOffset + row
if idx >= 0 && idx < m.containerEntryCount() {
prev := m.containerCursor
m.containerCursor = idx
m.ensureContainerCursorVisible()
if prev != m.containerCursor {
m.dbg("container selected (mouse): %d", m.containerCursor)
m = m.loadContainerView()
}
return m, nil
}
} else if msg.X >= sidebarWidth {
// Clicked in output pane
m.focusedPane = focusOutput
m.dbg("focus: mouse click → output")
}
}
// Forward clicks outside sidebar to viewport
var vpCmd tea.Cmd
m.viewport, vpCmd = m.viewport.Update(msg)
cmds = append(cmds, vpCmd)
return m, tea.Batch(cmds...)
}