Skip to content

feat: rewrite TermUI for 1.0 - #41

Closed
mikehostetler wants to merge 45 commits into
agentjido:developfrom
mikehostetler:develop
Closed

feat: rewrite TermUI for 1.0#41
mikehostetler wants to merge 45 commits into
agentjido:developfrom
mikehostetler:develop

Conversation

@mikehostetler

Copy link
Copy Markdown

Summary

  • Replace the component process system with one Elm-style runtime that owns application state and update order.
  • Make TermUI.Frame the complete render value and give one backend owner control of input, output, size, capabilities, and cleanup.
  • Replace process-owned widgets with parent-owned pure widgets under TermUI.Widget.
  • Add bounded commands and streams, Markdown and diff views, selection and mouse support, layout helpers, public boundary schemas, and an interactive showcase.
  • Add migration, architecture, feature-parity, package-quality, and release documentation for 1.0.0-rc.1.

Breaking changes

This is a breaking redesign of the published release candidate. It removes the component servers, registries, supervisors, render nodes, duplicate widget namespace, and legacy input and renderer systems. It also defers the SSH backend until it can own a complete terminal session. The migration guide contains the public replacement map.

Verification

  • mix quality
  • mix coveralls: 879 tests, 0 failures, 1 excluded, 93.5% total coverage
  • mix test test/term_ui/terminal/raw_mode_pty_test.exs: 1 test, 0 failures

The raw-mode PTY check confirms that Ctrl+O, Ctrl+C, Ctrl+S, and Ctrl+Q reach the application and that terminal flags are restored.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5f5de9a3ab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +140 to +141
defp color(:fg, index, _mode) when is_integer(index), do: ANSI.foreground_256(index)
defp color(:bg, index, _mode) when is_integer(index), do: ANSI.background_256(index)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Convert indexed colors before rendering in 16-color mode

When the TTY backend detects only :color_16 support and a frame contains a public Style using {:indexed, index}, Style.to_cell/2 converts it to an integer and this mode-independent clause emits a 256-color 38;5/48;5 sequence. A terminal limited to 16 colors can ignore or misrender that color, unlike RGB colors which are correctly converted by the later :color_16 clauses; convert indexed colors through the 16-color converter as well.

Useful? React with 👍 / 👎.

Comment on lines +133 to +136
scroll_y =
if state.follow_end,
do: max(length(rows) - state.page_size, 0),
else: min(state.scroll_y, max(length(rows) - 1, 0))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Clamp replacement scroll state to the last page

When set_content/2 shrinks a non-following viewport while its old scroll_y is near the end, this branch permits an offset as high as the last row rather than the last full page. view/2 then silently clamps the displayed offset via geometry/2, but position/1 and emitted scroll messages retain the larger value, so several Up presses can change state without moving the visible content. Clamp against length(rows) - page_size, as the follow_end branch already does.

Useful? React with 👍 / 👎.

@mikehostetler

Copy link
Copy Markdown
Author

The v2 work now lives on the native agentjido/term_ui branch next/v2. Clean head: 048ae09. The complete branch CI run passed: https://github.com/agentjido/term_ui/actions/runs/33503327264. This pull request is closed without a merge. Continue v2 work against next/v2.

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