Skip to content

Conversation

@taylorwilsdon
Copy link
Owner

@taylorwilsdon taylorwilsdon commented Dec 25, 2025

This PR introduces a major UI overhaul for Netshow using Solarized Dark theme, adaptive responsive design, and enhanced network monitoring capabilities including real-time bandwidth visualization.

Key Improvements

• Solarized Dark Theme: Complete visual redesign with color-coded status indicators
• Responsive Design: Adaptive layout that adjusts to terminal width (compact mode for narrow terminals)
• Real-time Bandwidth Sparkline: Visual graph showing network activity trends over time
• IPv6 Address Management: Auto truncation with toggle option (v key) for full expansion
• Performance Optimizations: Streamlined code formatting and improved rendering efficiency
• Enhanced Status Display: Rich text styling with Solarized color coding for connection states

Technical Changes

Theme & Styling (src/netshow/styles.py)

  • Migrated from Selenized to Solarized Dark color palette
  • Added color-coded metrics with distinct borders (blue for connections, green for active, cyan for listening, orange for bandwidth)
  • Improved responsive layout with adaptive spacing and sizing

Core Application (src/netshow/app.py)

  • Textual 3.0 Compatibility: Updated dependency from >=0.40.0 to >=3.0
  • Bandwidth Sparkline: Added real-time network activity visualization with 20-sample history
  • Responsive Metrics: Dynamic label adjustment based on terminal width
  • IPv6 Handling: Smart address truncation with […]:port format and toggle support
  • Rich Text Integration: Status indicators now use Rich Text objects with proper color styling

CLI Enhancement (src/netshow/cli.py)

  • Added truecolor support detection for optimal Solarized rendering

New Features

  • IPv6 Toggle: Press v to expand/collapse IPv6 addresses
  • Terminal Resize Handling: Automatic layout adjustment on terminal size changes
  • Bandwidth History: Visual sparkline showing network activity trends

UI/UX Improvements

  • Compact Mode: Automatically activates for terminals < 100 columns wide
  • Adaptive Interface Labels: Shows interface name only on wider terminals (≥120 columns)
  • Sparkline Visibility: Automatically hidden on narrow terminals (< 80 columns)
  • Status Colors: ESTABLISHED (green), LISTEN (blue), TIME_WAIT (yellow), errors (red)

Dependencies

  • Upgraded Textual requirement to >=3.0 for modern TUI capabilities
  • Added Rich Text support for enhanced styling

@taylorwilsdon taylorwilsdon self-assigned this Dec 25, 2025
@taylorwilsdon taylorwilsdon added the enhancement New feature or request label Dec 25, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates Netshow's UI from the Selenized Dark theme to Solarized Dark, while adding responsive design capabilities and real-time network monitoring features. The changes focus on improving visual clarity through color-coded status indicators and adapting the interface to different terminal widths.

Key Changes:

  • Complete theme migration from Selenized to Solarized Dark color palette with color-coded metric borders
  • Added responsive layout that adjusts labels and visibility based on terminal width (compact mode < 100 columns)
  • Introduced bandwidth sparkline visualization with 20-sample history and IPv6 address truncation toggle

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/netshow/types_and_constants.py Added "v" keybinding for IPv6 address expansion toggle
src/netshow/styles.py Replaced Selenized Dark theme with Solarized Dark palette, added sparkline styling and responsive metric borders
src/netshow/helpers.py Reformatted address formatting logic for improved readability
src/netshow/detail_screen.py Code formatting improvements for conditional expressions
src/netshow/cli.py Added truecolor environment variable detection for optimal theme rendering
src/netshow/app.py Implemented bandwidth sparkline, IPv6 truncation, responsive metrics, Rich Text status styling, and terminal resize handling
pyproject.toml Updated Textual dependency from >=0.40.0 to >=3.0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +424 to +426
# Rich Text object - extract plain text and remove emoji prefix
status_text = status_cell.plain
# Remove emoji prefix if present (emoji + space = ~3 chars)
Copy link

Copilot AI Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment states 'emoji + space = ~3 chars' but the code uses split(' ', 1)[-1] which only splits on a single space character. Emojis can be 1-4 bytes in UTF-8, but the code doesn't account for character length. The comment should be updated to accurately describe the string splitting operation being performed.

Suggested change
# Rich Text object - extract plain text and remove emoji prefix
status_text = status_cell.plain
# Remove emoji prefix if present (emoji + space = ~3 chars)
# Rich Text object - extract plain text and remove emoji/icon prefix
status_text = status_cell.plain
# Remove leading emoji/icon prefix and following space by taking text after the first space

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants