Skip to content

UX: Add word wrap and margins to oclite output #87

@randomm

Description

@randomm

Problem

  1. Text output wraps at terminal edge, breaking mid-word. Long paragraphs are hard to read.
  2. No left/right margins — content starts at column 0, feels cramped.

Solution

  • Set max content width to ~100 chars (or terminal width - 4, whichever is smaller)
  • Add 2-char left padding to all output (text, tools, rules, metrics)
  • Word-wrap text at the max width boundary

Implementation

Add a wrap(text, width) utility that:

  1. Splits text into words
  2. Joins words into lines that don't exceed width
  3. Preserves existing line breaks

Apply left padding via a pad constant (" ") prepended to all write() calls in the output path.

Screenshots

QA round 3 — Image 3 shows text wrapping at terminal edge.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions