chore(tui): delete dead braille code, hoist sparkWidth, stop resize flash
1. Delete braille.go + braille_test.go — dead code, only referenced by its own test. Can be re-added when latency charts are built. 2. Hoist duplicate `const sparkWidth = 40` (update.go + view_detail.go) to package-level `detailSparkWidth`. Click-index resolution and rendering now share one constant. 3. Remove tea.ClearScreen on every resize — caused full-screen flash during continuous resizes. ctrl+l manual clear kept.
This commit was merged in pull request #115.
This commit is contained in:
@@ -207,9 +207,8 @@ func (m Model) viewDetailPanel() string {
|
||||
}
|
||||
|
||||
b.WriteString(m.divider() + "\n")
|
||||
const sparkWidth = 40
|
||||
if site.Type == "push" {
|
||||
b.WriteString(" " + m.zones.Mark("spark-heartbeat", m.heartbeatSparkline(hist.Statuses, sparkWidth, "")))
|
||||
b.WriteString(" " + m.zones.Mark("spark-heartbeat", m.heartbeatSparkline(hist.Statuses, detailSparkWidth, "")))
|
||||
if len(hist.Statuses) > 0 {
|
||||
up := 0
|
||||
for _, s := range hist.Statuses {
|
||||
@@ -222,7 +221,7 @@ func (m Model) viewDetailPanel() string {
|
||||
up, len(hist.Statuses))
|
||||
}
|
||||
} else {
|
||||
b.WriteString(" " + m.zones.Mark("spark-latency", m.latencySparkline(hist.Latencies, hist.Statuses, sparkWidth, "")))
|
||||
b.WriteString(" " + m.zones.Mark("spark-latency", m.latencySparkline(hist.Latencies, hist.Statuses, detailSparkWidth, "")))
|
||||
var minL, maxL, total time.Duration
|
||||
count := 0
|
||||
for i, l := range hist.Latencies {
|
||||
@@ -249,7 +248,7 @@ func (m Model) viewDetailPanel() string {
|
||||
}
|
||||
|
||||
if m.sparkTooltipIdx >= 0 {
|
||||
b.WriteString("\n" + m.renderSparkTooltip(site, hist, sparkWidth))
|
||||
b.WriteString("\n" + m.renderSparkTooltip(site, hist, detailSparkWidth))
|
||||
}
|
||||
|
||||
b.WriteString("\n")
|
||||
|
||||
Reference in New Issue
Block a user