Skip to content

feat(core): add fullscreen mode for screens#101

Merged
zrosenbauer merged 1 commit intomainfrom
feat/fullscreen-mode
Mar 24, 2026
Merged

feat(core): add fullscreen mode for screens#101
zrosenbauer merged 1 commit intomainfrom
feat/fullscreen-mode

Conversation

@zrosenbauer
Copy link
Member

Summary

  • Add <FullScreen> component, useFullScreen hook, and useTerminalSize hook for alternate screen buffer support in Ink-based TUIs
  • Add fullscreen?: boolean option to ScreenDef that automatically wraps the component tree in <FullScreen> with a finally safety net
  • Rename kitchen-sink example to tui and enable fullscreen mode on the dashboard command

Test plan

  • pnpm check passes (typecheck + lint + format)
  • pnpm test --filter=@kidd-cli/core passes (744 tests)
  • Run tui example with pnpm dev -- dashboard and verify alternate screen buffer activates
  • Verify scrollback history is preserved after exiting the dashboard (Ctrl-C or q)
  • Verify useFullScreen() returns reactive columns/rows on terminal resize

Add alternate screen buffer support for Ink-based TUIs:

- `FullScreen` component: enters/exits alt screen buffer on mount/unmount
  with idempotent cleanup handlers for SIGINT, SIGTERM, and process.exit
- `useFullScreen` hook: reads terminal dimensions and fullscreen state
  from context, falls back to process.stdout when outside FullScreen
- `useTerminalSize` hook: standalone terminal dimension tracking with
  resize events
- `fullscreen` option on ScreenDef: wraps the component tree in
  FullScreen automatically, with a finally safety net in renderFn
- Rename kitchen-sink example to tui, enable fullscreen on dashboard

Co-Authored-By: Claude <noreply@anthropic.com>
@changeset-bot
Copy link

changeset-bot bot commented Mar 24, 2026

🦋 Changeset detected

Latest commit: 416d8de

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@kidd-cli/core Minor
@kidd-cli/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Mar 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
oss-kidd Error Error Mar 24, 2026 7:57pm

Request Review

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 24, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing feat/fullscreen-mode (416d8de) with main (adb2879)

Open in CodSpeed

@zrosenbauer zrosenbauer merged commit a53ee68 into main Mar 24, 2026
5 of 7 checks passed
@zrosenbauer zrosenbauer deleted the feat/fullscreen-mode branch March 24, 2026 20:03
@coderabbitai
Copy link

coderabbitai bot commented Mar 24, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This pull request introduces fullscreen terminal UI capabilities to the core package and migrates the example CLI from kitchen-sink to tui. The changes add a new fullscreen.tsx module implementing terminal alternate screen buffer management via ANSI escape sequences, a FullScreen React component with context-based state sharing, and hooks (useFullScreen, useTerminalSize) for dimension queries. The screen.tsx renderer is updated to conditionally wrap screens in the FullScreen component based on configuration. The tui example's dashboard command is enhanced to display terminal dimensions in fullscreen mode, while kitchen-sink example logic is removed and the tui example receives the CLI entrypoint registration.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main feature addition: fullscreen mode support for screens in the core library.
Description check ✅ Passed The description accurately outlines the key changes: FullScreen component, hooks, fullscreen option in ScreenDef, and the kitchen-sink to tui example rename with fullscreen dashboard.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/fullscreen-mode

Comment @coderabbitai help to get the list of available commands and usage tips.

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