Skip to content

feat(pi-glowup)!: format and color script previews - #9

Merged
zigai merged 1 commit into
masterfrom
feat/glowup-script-previews
Oct 15, 2026
Merged

zigai merged 1 commit into
masterfrom
feat/glowup-script-previews

Conversation

@zigai

@zigai zigai commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Script preview formatters were bare commands, with no settings for each language. Built-in profiles for Python, JavaScript, TypeScript and Bash now fit each preview to the terminal width without changing the code that runs.

  • Each supported language has a profile with its own options, such as indent width
  • Previews are formatted again when the terminal is resized
  • Only a finished, collapsed call shows the formatted preview. Running and expanded calls show the code as written
  • Bash previews keep comments and heredocs when a long command is split across lines
  • Long code blocks keep their colors when pi repaints them
  • Long code is colored in a worker thread instead of on the UI thread

Breaking Changes

  • scriptPreview.formatters entries, in settings files and in PI_GLOWUP_SCRIPT_FORMATTERS, are profile objects instead of argv arrays. Old array entries are skipped with a warning, and previews for their language stay unformatted
-"python": ["ruff", "format", "-"]
+"python": {"kind": "command", "command": ["ruff", "format", "-"]}

Verification

  • In a real pi session with an oxfmt profile, a running Node call shows the script as written and formats it on completion
  • if check; then first; else # the else branch reflows with the comment on its branch, and bash -n accepts both the original and the reflowed command
  • A long code block keeps its colors when pi repaints it many times and after its entry drops out of the color cache
  • Installed from the packed tarball, without pi's own packages next to the extension, long lines are still colored

@zigai
zigai merged commit b02f747 into master Oct 15, 2026
4 checks passed
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.

1 participant