commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

Feat: interactive live subject preview

Open ttw225 opened this issue 8 months ago • 0 comments

Description

During cz commit interactive prompts, show a live preview of the first line (subject) and a bottom character counter (with support for message_length_limit). This helps users see the final rendered subject while typing scope/subject and prevents overly long subjects.

Possible Solution

The implementation is based on Questionary's bottom_toolbar

  • Enhance interactive questions by attaching:
    • bottom_toolbar: render the live subject preview + character counter; wrap by terminal display width and handle CJK/full-width characters correctly.
    • validate: enforce subject length using message_length_limit (0 means no limit).
  • Use closures to keep an in-memory answers/input state and update the preview/validation in real time as the user types.

Additional context

Image Image

Related issues

No response

ttw225 avatar Mar 18 '26 10:03 ttw225