fix: SFTP stacked mode — render only active pane + indicator bar

Stacked mode (<50 cols) now shows only the active pane (Local/Remote)
with a visual indicator bar. Tab switches between panes. Side-by-side
mode (>=50 cols) unchanged.
This commit is contained in:
swanadiva
2026-06-24 11:22:21 +07:00
parent c114b2435c
commit 2e10308c75
3 changed files with 37 additions and 20 deletions
+6 -16
View File
@@ -63,22 +63,12 @@
✅ Fixed bug: key_list_tab.go & snippet_list_tab.go dropped last row (`rows[:len(rows)-1]` excluded real data)
✅ Breakpoints: compact (<60 cols / mobile), medium (60100 / tablet), wide (≥100 / desktop)
### Next: SFTP Stacked Mode Fix
**File**: `pkg/tui/sftp_browser_tab.go`
**Masalah**: Stacked mode (<50 cols) render 2 pane vertikal, masing-masing
`t.height-6` entries. Total 2x tinggi terminal. Pane kedua menutupi pane pertama.
Tab switch bekerja tapi tidak terlihat karena cuma 1 pane visible.
**Solusi**:
- Stacked mode: render cuma ACTIVE pane (bukan 2 pane)
- Tambah pane indicator bar: `[Local] Remote` (active disorot hijau)
- Side-by-side mode (>=50 cols): TIDAK DIUBAH, tetap 2 pane
**Detail implementasi**:
1. Di `View()`, ganti blok `if t.width < 50`:
- Render cuma `t.renderPane(activePane, paneW)` bukan keduanya
- Tambah indicator bar sebelum pane: active pane disorot `StatusBarStyle`, inactive `SubtitleStyle`
2. `maxDisplay` tidak perlu diubah (cuma 1 pane, full height)
3. Footer tetap sama (sudah wrapped)
**Prioritas**: HIGH
### Done: SFTP Stacked Mode Fix
**File**: `pkg/tui/sftp_browser_tab.go`
Stacked mode (<50 cols): render cuma ACTIVE pane (bukan 2 pane)
✅ Pane indicator bar: `[Local] Remote` — active disorot hijau (StatusBarStyle)
✅ Side-by-side mode (>=50 cols): tidak diubah, tetap 2 pane
`maxDisplay` tidak diubah (cuma 1 pane, full height)
---