Skip to content

[Phase 7B] Dirty-region rendering: widget dirty flags + conditional re-render #30

@fissible

Description

@fissible

What

First: verify whether this is already complete. v0.1.0 shipped "dirty-region rendering — skip screen_clear on cursor movement + button toggle". Check whether the full spec below is implemented before writing any new code. Close this issue if it is.

Full spec:

  • Each widget exposes a dirty flag (or the app loop tracks it centrally) so shellframe_screen_clear is only called when a full repaint is needed — not on every key event.
  • Render functions continue writing directly to /dev/tty — no API break. Framebuffer migration is task F.
  • The shellframe_shell main loop checks dirty state before triggering re-render; a no-op key event that changes no state should not cause a screen repaint.

Files

  • src/screen.sh — dirty flag helpers if not already present
  • src/shell.sh — conditional re-render in main loop
  • Widget render functions — mark dirty on meaningful state changes (selection move, scroll, text edit)

Done criteria

  • shellframe_screen_clear is NOT called on every key event — only when a full repaint is needed
  • Widget dirty state is set on meaningful state changes
  • App loop skips re-render when nothing is dirty
  • No existing widget API changes — callers unaffected
  • Regression tests covering the dirty → render → clean cycle
  • All existing assertions still pass

IO/timing note (CLAUDE.md §5)

"What sets dirty" and "what triggers redraws" are terminal behavior claims. Write a test that confirms a no-op key event does not invoke shellframe_screen_clear — do not rely on code inspection alone.

Effort

M (~half day) — or XS if already done in v0.1.0

Deps

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