Skip to content

feat(app): expose TuiApp.copyToClipboard - #115

Merged
leoafarias merged 1 commit into
mainfrom
feat/app-copy-to-clipboard
Oct 22, 2026
Merged

leoafarias merged 1 commit into
mainfrom
feat/app-copy-to-clipboard

Conversation

@leoafarias

@leoafarias leoafarias commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Apps had no public way to copy text to the system clipboard. The OSC 52 path existed only on the @internal BuildOwner.copyToClipboard and on the low-level Renderer extension, and an app can't reach either through TuiApp.

TuiApp.copyToClipboard(text) forwards to the renderer the app owns. It returns whether the escape sequence was written, not whether the terminal honored it. It writes nothing and returns false for empty text or a headless app.

Stargate's CLI run view uses it for its "Copy Markdown" button (btwld/stargate-dart, stacked PRs).

Changes

  • lib/src/app/app.dart: the new method, with a doc comment.
  • README.md: a paragraph next to the other TuiApp controls.
  • test/app/tui_app_facade_test.dart: covers forwarding to the renderer (UTF-8 text and a declined write), empty text, the headless app, and rejection after dispose.
  • test/architecture/public_member_seams_test.dart: adds the member to the audited TuiApp surface.

Release note

tool/release.dart check requires CHANGELOG.md to lead with the manifest version, so this PR doesn't touch the changelog. The next release prep should add an "Added" line for TuiApp.copyToClipboard.

Validation

From packages/noir/:

  • dart analyze --fatal-infos: no issues.
  • dart test test/app/tui_app_facade_test.dart test/architecture/ --concurrency=1: 270 passed.
  • dart run tool/release.dart check: ready.
  • dart format --set-exit-if-changed: the changed files are clean. Nine untouched test files on main report drift under the local SDK (3.13.4).

Apps had no public way to put text on the system clipboard: the OSC 52
path existed only on the internal BuildOwner and the low-level Renderer
extension. TuiApp.copyToClipboard forwards to the renderer the app owns
and reports whether the sequence was written. It writes nothing and
returns false for empty text or a headless app.

Co-Authored-By: Claude <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T01:04:36.845575Z 2e41242 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@leoafarias
leoafarias merged commit de5b761 into main Oct 22, 2026
8 checks passed
@leoafarias
leoafarias deleted the feat/app-copy-to-clipboard branch October 22, 2026 13:42
leoafarias added a commit that referenced this pull request Oct 22, 2026
Prepare Noir 0.0.5. It adds TuiApp.copyToClipboard (#115); fixes
paragraph alignment, character keys, cleared text edits, highlight
ranges, Select and DiffView cell painting, and the hot-reload runner's
second Ctrl+C (#105, #106, #110, #112); and removes unused prerelease
API (#107, #111). The changelog names every removed public member, and
the architecture test pins those release contracts.

noir_driver 0.0.1-alpha.2 is already on pub.dev with noir: ^0.0.4, so
its section stays as published and the driver moves to 0.0.1-alpha.3
to require noir: ^0.0.5. The unpublished noir_signals 0.0.1-alpha.2
now requires noir: ^0.0.5, with its checkout guidance.

The native ABI and bundled native artifacts are unchanged from 0.0.4.
Published availability stays at what publication.json records until
protected publication confirms the new versions.
leoafarias added a commit that referenced this pull request Oct 23, 2026
Prepare Noir 0.0.5. It adds TuiApp.copyToClipboard (#115); fixes
paragraph alignment, character keys, cleared text edits, highlight
ranges, Select and DiffView cell painting, and the hot-reload runner's
second Ctrl+C (#105, #106, #110, #112); and removes unused prerelease
API (#107, #111). The changelog names every removed public member, and
the architecture test pins those release contracts.

Both companions leave alpha as 0.0.1 and require noir: ^0.0.5:
noir_driver after the published 0.0.1-alpha.2, and noir_signals after
the published 0.0.1-alpha.1. Neither library changed since those
archives, and their changelog sections stay byte-for-byte as
published. Noir's noir_driver dev dependency, the tag examples, the
checkout guidance, and the testing page follow.

publication.json now records noir_driver 0.0.1-alpha.2, which was
published on 2026-10-19 when only its record step failed, and
availability.ts is regenerated from it. Hosted install guidance keeps
naming what pub.dev serves until protected publication confirms the
new versions.

The native ABI and bundled native artifacts are unchanged from 0.0.4.
leoafarias added a commit that referenced this pull request Oct 23, 2026
Prepare Noir 0.0.5. It adds TuiApp.copyToClipboard (#115); fixes
paragraph alignment, character keys, cleared text edits, highlight
ranges, Select and DiffView cell painting, and the hot-reload runner's
second Ctrl+C (#105, #106, #110, #112); and removes unused prerelease
API (#107, #111). The changelog names every removed public member, and
the architecture test pins those release contracts.

Both companions leave alpha as 0.0.1 and require noir: ^0.0.5:
noir_driver after the published 0.0.1-alpha.2, and noir_signals after
the published 0.0.1-alpha.1. Neither library changed since those
archives, and their changelog sections stay byte-for-byte as
published. Noir's noir_driver dev dependency, the tag examples, the
checkout guidance, and the testing page follow.

publication.json now records noir_driver 0.0.1-alpha.2, which was
published on 2026-10-19 when only its record step failed, and
availability.ts is regenerated from it. Hosted install guidance keeps
naming what pub.dev serves until protected publication confirms the
new versions.

The native ABI and bundled native artifacts are unchanged from 0.0.4.
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