Skip to content

Conversation

@musaprg
Copy link
Member

@musaprg musaprg commented Jun 28, 2025

Summary

Comprehensive improvements to CLI output readability across all commands:

  • Timestamps: Format Unix milliseconds as readable "MM/DD HH:MM" instead of raw numbers (e.g., "06/29 00:30" vs "1751124600000")
  • Boolean values: Use compact symbols (✓/-/✗) instead of verbose "true"/"false" text for better scanning
  • Large IDs: Intelligently shorten long ID numbers (e.g., "...23608" instead of "3239123608") while preserving uniqueness
  • Status indicators: Use intuitive symbols (✓/✗/⏰) for rule status instead of lengthy text descriptions
  • Channel types: Use descriptive Japanese labels ("地上波" instead of technical "GR" abbreviation)
  • Description truncation: Automatically limit long text fields to prevent overwhelming table width

Key Changes

Enhanced Output Formatter (internal/output/formatter.go)

  • Added formatValueWithContext() for field-aware formatting
  • Intelligent timestamp parsing for both int and int64 Unix milliseconds
  • Smart boolean formatting with context-appropriate symbols
  • ID shortening for better readability while maintaining distinctiveness
  • Automatic text truncation for descriptions and long fields

Improved Rules Display (internal/commands/rules/rules.go)

  • Status symbols: ✓ (enabled), ✗ (disabled), ⏰ (time-based)
  • Descriptive channel labels with Japanese terms
  • More compact and scannable rule listings

Impact

These changes significantly improve the user experience by:

  • Reducing cognitive load: Symbols are faster to parse than text
  • Better terminal fit: Shortened IDs and descriptions prevent horizontal scrolling
  • Improved scannability: Consistent formatting makes data easier to find
  • Universal benefits: All commands (channels, programs, recordings, reserves, encodes, rules) benefit

Test Plan

  • Tested timestamp formatting with reserves and programs commands
  • Verified boolean symbol display across multiple command outputs
  • Confirmed ID shortening works correctly for large channel/program IDs
  • Validated rule status symbols display properly
  • Ensured Japanese channel labels render correctly
  • Tested description truncation prevents table overflow

Compatibility

  • No breaking changes to JSON output format
  • All existing functionality preserved
  • Maintains backward compatibility with automation scripts
  • Only affects table output formatting for improved human readability

}
channelParts = append(channelParts, "CS")
}

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
File is not properly formatted (gofmt)

musaprg added 3 commits June 28, 2025 21:23
Major improvements to make CLI output more human-readable:

- **Timestamps**: Format Unix milliseconds as "MM/DD HH:MM" instead of raw numbers
- **Boolean values**: Use symbols (✓/-/✗) instead of "true"/"false" for better scanning
- **Large IDs**: Shorten long ID numbers (e.g., "...23608" instead of "3239123608")
- **Status indicators**: Use symbols (✓/✗/⏰) for rule status instead of text
- **Channel types**: Use descriptive labels ("地上波" instead of "GR")
- **Description truncation**: Limit long text fields to prevent table overflow

These changes apply to all commands and significantly improve terminal readability
while maintaining full functionality. Output now fits better in terminal windows
and is much easier to scan quickly.
Enhanced reserves and encodes commands with comprehensive improvements:

**Custom Column Display:**
- Default: Essential columns only for better terminal fit
- Verbose (`--verbose`): Additional detail columns
- Full (`--full`): All available columns
- Custom (`--columns`): User-specified column selection

**Readability Improvements:**
- Timestamps: Format Unix milliseconds as "MM/DD HH:MM"
- Boolean values: Use symbols (✓/-/✗) instead of "true"/"false"
- Large IDs: Shorten long numbers for better scanning
- Description truncation: Prevent table overflow

**Reserves Command:**
- Default columns: Id, Name, StartAt, EndAt, ChannelId, IsConflict, IsSkip, IsOverlap
- Verbose adds: RuleId, ProgramId, Description
- Reduced default limit from 24 to 10 items

**Encodes Command:**
- Default columns: ID, Mode, Status, Percent, Name
- Verbose adds: Log
- Smart status display for running/waiting jobs

These changes significantly improve CLI usability while maintaining full functionality.
@musaprg musaprg force-pushed the feature/improve-output-readability branch from bf6a512 to f406421 Compare June 28, 2025 12:26

var formatter output.Formatter
switch cfg.Output.Format {
case "json":

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
string json has 3 occurrences, make it a constant (goconst)


var formatter output.Formatter
switch cfg.Output.Format {
case "json":

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
string json has 4 occurrences, make it a constant (goconst)

- Exclude binaries, build artifacts, and test outputs
- Ignore IDE files and OS-generated files
- Exclude environment variables and logs
- Add project-specific binary name (epgstationctl)
- Include common Node.js artifacts for any frontend components
- Exclude coverage reports and profiling data
@musaprg musaprg merged commit 5730594 into main Jun 28, 2025
2 checks passed
@musaprg musaprg deleted the feature/improve-output-readability branch June 28, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants