Skip to content

Add widget expansion and split ratio adjustment features #886

@sarub0b0

Description

@sarub0b0

Background

When viewing logs in kubetui, users often need to see more information than the current fixed layout allows. This is especially true for:

  • Long error messages or stack traces
  • JSON formatted logs
  • Comparing logs across multiple pods

Use Cases

  1. Full-screen log viewing: When investigating detailed logs or errors, users want to maximize the log widget to see as much information as possible.

  2. Flexible pod list + log layout: When switching between multiple filtered pods, users want to adjust the split ratio between the pod list and log viewer to optimize their workflow.

Proposed Features

1. Widget Expansion Mode

Allow users to temporarily expand the active widget to full screen (or near full screen).

Benefits:

  • Maximize visible log content
  • Toggle back to normal layout easily
  • Works with any active widget

Proposed keybinding: z key

2. Split Ratio Adjustment

Allow users to dynamically adjust the size ratio between widgets in a split layout.

Benefits:

  • Customize layout to personal preference
  • Balance between pod list visibility and log detail
  • Flexible workflow for different tasks

Proposed keybindings:

  • + or =: Increase active widget size (+10%)
  • - or _: Decrease active widget size (-10%)
  • 0: Reset to default layout

Scope

Files to Modify

  • src/ui/tab.rs: Add expansion mode and ratio adjustment to Tab and TabLayout
  • src/ui/window.rs: Add keybindings for new features
  • Tests: Ensure layout calculations work correctly

Implementation Phases

Phase 1: Widget Expansion Mode

  • Add expansion state tracking to Tab
  • Modify layout calculation to handle expanded state
  • Add keybinding

Phase 2: Split Ratio Adjustment

  • Add dynamic constraint adjustment to TabLayout
  • Support min/max limits (e.g., 20%-80%)
  • Add keybindings

Example Workflow (Vertical Split)

[Normal: 45:55]          [Adjusted: 30:70]        [Expanded: 100%]
┌─────────────┐          ┌─────────────┐          ┌─────────────┐
│  Pod List   │          │  Pod List   │          │             │
│             │   +/- →  │   (30%)     │   z →    │             │
├─────────────┤          ├─────────────┤          │             │
│             │          │             │          │  Log View   │
│  Log View   │          │  Log View   │          │   (100%)    │
│   (55%)     │          │   (70%)     │          │             │
│             │          │             │          │             │
└─────────────┘          └─────────────┘          └─────────────┘
                                          z ← (toggle back)

Notes

  • Both features should work independently and not conflict
  • Expansion mode should work on any active widget, not just logs
  • Split ratio adjustment should respect layout constraints (nested layouts)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions