Responsive Layouts
The TONL Visual Dashboard automatically adapts to your terminal size for optimal viewing on any screen.
Overview
The Visual Dashboard (v1.0.0) includes intelligent responsive layouts that detect terminal width and adjust the interface accordingly. This ensures professional presentation on everything from large 4K monitors to small MacBook Air screens.
Layout Modes
Full Mode (≥100 columns)
Activates when: Terminal width is 100 columns or wider
Features:
- Two-column layout
- Full metric cards
- Detailed progress bars (40 chars)
- Complete recommendation text
- All keyboard shortcuts visible
Example Output:
╔╦╗ ╔═╗ ╔╗╔ ╦
║ ║ ║ ║║║ ║
╩ ╚═╝ ╝╚╝ ╩═╝
ROI Analyzer MCP: 🟢 Online (45ms) v1.0.0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Token Usage Analysis 💰 Cost Impact
data.json gpt-4o pricing
JSON ████████████████████ 477 $1.19 per 1K queries
TONL ██████████░░░░░░░░░░ 255 $0.64 per 1K queries
✓ 46.5% reduction 💎 $0.55 savings
Recommendation: STRONG ADOPT Annual: $202.57/year
@ 1K requests/day
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
q: Quit │ e: Export CSV │ s: Screenshot
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Compact Mode (<100 columns)
Activates when: Terminal width is less than 100 columns
Features:
- Single-column layout
- Essential metrics only
- Shorter progress bars (30 chars)
- Abbreviated labels
- Optimized for small screens
Example Output:
╔╦╗ ╔═╗ ╔╗╔ ╦
║ ║ ║ ║║║ ║
╩ ╚═╝ ╝╚╝ ╩═╝
ROI Analyzer MCP: 🟢 45ms v1.0.0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Tokens
data.json
JSON ███████████████ 477
TONL ████████░░░░░░░ 255 (-46.5%)
💰 Costs (gpt-4o)
Before: $1.19/1K
After: $0.64/1K
Save: $0.55/1K
📈 Annual: $202.57
✓ STRONG ADOPT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
q: Quit │ e: Export │ s: Screen
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━Automatic Detection
The dashboard automatically detects terminal width:
const { columns } = process.stdout;
const isCompact = columns < 100;No configuration needed! Just run the command:
tonl analyze data.json --visualTerminal Size Examples
Large Desktop (140 cols)
# Full mode with plenty of space
tonl analyze data.json --visualPerfect for presentations and detailed analysis.
Standard Laptop (120 cols)
# Full mode, comfortable viewing
tonl analyze data.json --visualDefault experience for most developers.
MacBook Air 13" (80 cols)
# Compact mode, optimized layout
tonl analyze data.json --visualStill fully functional with reduced width.
Vertical Split (60 cols)
# Compact mode, essential info only
tonl analyze data.json --visualWorks even in split-screen setups.
Responsive Elements
Progress Bars
Full Mode: 40 characters wide
████████████████████████████████████████ 477 tokensCompact Mode: 30 characters wide
██████████████████████████████ 477Metric Cards
Full Mode: Detailed cards with icons
📊 Token Usage Analysis
data.json
JSON ████████████████████ 477 tokens
TONL ██████████░░░░░░░░░░ 255 tokens
✓ 46.5% reductionCompact Mode: Condensed format
📊 Tokens
JSON ███████████████ 477
TONL ████████░░░░░░░ 255 (-46.5%)Cost Table
Full Mode: Full table with headers
💰 Cost Analysis (GPT-4o)
Per 1K Per 1M
──────────────────────────────────────────────────
JSON $1.19 $1,192.50
TONL $0.64 $637.50
──────────────────────────────────────────────────
💎 NET SAVINGS $0.55 $555.00Compact Mode: Simple list
💰 Costs (gpt-4o)
Before: $1.19/1K
After: $0.64/1K
Save: $0.55/1KKeyboard Shortcuts
Full Mode: Full labels
q: Quit │ e: Export CSV │ s: ScreenshotCompact Mode: Abbreviated
q: Quit │ e: Export │ s: ScreenUse Cases
Presentations on Projector
Use full mode for maximum impact:
# Maximize terminal for presentations
tonl analyze demo-data.json --visualLarge text and detailed layout perfect for audiences.
Laptop Development
Standard view for daily work:
# Normal terminal size
tonl analyze data.json --visualComfortable viewing during development.
Split Screen Coding
Compact mode works alongside code:
# Terminal split with editor
tonl analyze data.json --visualEssential info without taking full screen.
Remote SSH Sessions
Works on any terminal size:
ssh server
tonl analyze remote-data.json --visualAdapts to remote terminal dimensions.
Manual Override
Force Full Mode
Use wider terminal manually:
# Resize terminal to 120+ columns
tonl analyze data.json --visualForce Compact Mode
Use narrower terminal manually:
# Resize terminal to 80 columns
tonl analyze data.json --visualCheck Terminal Size
# View current dimensions
tput cols # Width
tput lines # HeightBest Practices
Maximize for Presentations
Before demos, maximize terminal:
# macOS: Cmd+Shift+Enter
# Linux: F11
# Windows: Alt+Enter
tonl analyze data.json --visualUse Split View for Development
Keep dashboard visible while coding:
# Left pane: code editor (70 cols)
# Right pane: dashboard (50 cols)
tonl analyze data.json --visualTest on Target Display
If presenting remotely, test on similar resolution:
# Simulate client screen size
resize -s 40 100 # 40 rows, 100 cols
tonl analyze data.json --visualConsider Audience View
For screen sharing, use full mode:
- Larger text is easier to read
- More detail visible
- Professional appearance
Technical Details
Detection Logic
const terminalWidth = process.stdout.columns;
const useCompactMode = terminalWidth < 100;
if (useCompactMode) {
return <CompactLayout {...props} />;
} else {
return <FullLayout {...props} />;
}Breakpoints
| Width | Mode | Layout |
|---|---|---|
| 140+ | Full | Spacious, ideal |
| 100-139 | Full | Standard |
| 80-99 | Compact | Optimized |
| 60-79 | Compact | Minimal |
| <60 | Compact | Very tight |
Performance
Layout switching is instant:
- No re-rendering delay
- Smooth transitions
- No flickering
Troubleshooting
Layout Looks Wrong
Check terminal size:
echo "Width: $(tput cols), Height: $(tput lines)"Resize terminal:
# macOS/Linux
resize -s 40 120
# Windows
mode con: cols=120 lines=40Text Wrapping Incorrectly
Increase terminal width:
# Make terminal wider
# Or use compact mode naturallyCheck font size:
- Larger fonts = fewer columns
- Reduce font size for more space
Progress Bars Misaligned
Verify Unicode support:
echo "█░▓▒"
# Should show solid/empty blocksUpdate terminal:
- Use modern terminal emulator
- Enable UTF-8 encoding
Future Enhancements
Planned improvements:
- Three breakpoints (small/medium/large)
- Custom width thresholds
- Orientation detection
- Dynamic font sizing
- Mobile terminal support
See Also
- Visual Dashboard - Dashboard overview
- Keyboard Shortcuts - Navigation
- CLI Reference - All commands
- Installation - Setup guide