-
Notifications
You must be signed in to change notification settings - Fork 8
feat: comprehensive TUI enhancements and features #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shuv1337
wants to merge
7
commits into
Hona:master
Choose a base branch
from
shuv1337:pr/feature-bundle
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add comprehensive theming support with theme files for popular color schemes: - Theme JSON files: catppuccin, dracula, nord, tokyo-night, gruvbox, monokai, etc. - Theme resolver for loading themes from opencode config - ThemeContext provider for reactive theme access - Theme color accessor functions with fallbacks Themes are compatible with opencode's theme format and support dynamic switching based on user preferences.
Add reusable UI infrastructure for user interaction: Dialog System: - DialogContext with stack-based dialog management - Dialog base component with overlay and Escape handling - DialogAlert for message notifications - DialogConfirm with Y/N keyboard shortcuts - DialogPrompt with text input field - DialogSelect for selection with fuzzy search support Toast System: - ToastContext with ToastProvider for global notifications - ToastStack component for displaying stacked notifications - Auto-dismiss with fade-out animation - Support for info/success/error toast types
Add VS Code-style command palette for quick action access: - CommandContext for registering and executing commands - Centralized keymap with keybind definitions - Fuzzy search via fuzzysort for filtering commands - Ctrl+P keyboard shortcut to open palette - Support for command categories and shortcuts display Commands can be registered dynamically and include actions like: - Pause/Resume loop execution - Copy attach command - Toggle tasks panel - Choose default terminal
Add cross-platform utilities for terminal and clipboard operations: Terminal Launcher: - Detect installed terminals on macOS, Linux, and Windows - Support for popular terminals: Kitty, Alacritty, WezTerm, iTerm2, etc. - Terminal selection dialog for choosing preferred terminal - Launch terminal with opencode attach command Clipboard: - Cross-platform clipboard detection (pbcopy, xclip, xsel, wl-copy) - Async copy function with fallback handling - Integration with toast notifications for feedback Config: - Persistent config module for user preferences - Terminal preference storage in .ralph-config.json
Major enhancements to the core loop functionality: External Server Support: - --server and --server-timeout CLI options - Server URL validation and health checking - Connect to existing opencode servers Custom Prompt Files: - --prompt-file option with .ralph-prompt.md.example template - buildPrompt() with precedence: CLI > file > default - Placeholder replacement for task description Error Retry: - Exponential backoff with jitter for transient errors - Retry countdown display in TUI - Configurable retry behavior Session Steering: - Session lifecycle callbacks (onSessionCreated, onSessionEnded) - sendMessage() for sending messages to active sessions - Session guard to prevent sending to inactive sessions State Management Hooks: - useLoopState: Reducer pattern for loop state - useLoopStats: Iteration timing and ETA tracking - useActivityLog: Session activity logging - useSessionStats: Token usage tracking Event Types: - Centralized event types with icons and colors - Verbose event marking for dim styling - Detail field for tool arguments - parsePlanTasks() for tasks panel
Wire up all new features into the main application: App Integration: - Wrap app with ThemeProvider, DialogProvider, ToastProvider, CommandProvider - Add keyboard handlers: Ctrl+P (palette), T (terminal), Shift+T (tasks) - Add colon key detection for steering mode - Register commands: pause/resume, copy attach, tasks, terminal Component Updates: - Header: Add [DEBUG] badge, use theme colors - Footer: Add token display, steering hint, theme colors - Log: Use theme colors, render event details, dim verbose events - Paused: Use theme colors New Components: - Steering overlay for live session interaction - Tasks panel with plan task display CLI Enhancements: - --debug / -d flag for manual session control - --agent / -a flag for agent selection - Build-time version injection - Improved TUI render options Debug Mode: - Skip automatic loop start - N key for new session - P key for prompt input
README Updates: - Document --server and --server-timeout options - Document --prompt-file option - Document --debug and --agent flags AGENTS.md Updates: - Add local build and install instructions - Document version handling (build-time injection) - Add version bumping workflow - Document OpenTUI configuration Configuration: - Add CONTEXT/ and bin/ to .gitignore - Add .ignore for ripgrep exclusions - Add docs for OpenTUI theme colors fix - Add docs for command palette fix - Update plan.md as minimal test plan
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a comprehensive set of TUI enhancements and new features to opencode-ralph, organized into 7 atomic commits for easier review.
Features
Theme System (29 themes)
UI Infrastructure
Terminal & Clipboard
Tkey to open terminal with attach commandLoop Enhancements
--serverand--server-timeoutoptions to connect to existing opencode servers--prompt-fileoption with placeholder replacement:keyDebug Mode
--debug/-dflag for manual session controlNkey for new session,Pkey for prompt inputTasks Panel
Shift+Tto toggle tasks panel showing plan.md checklist itemsTesting
Commits
feat: add theme system with 29 color themesfeat: add dialog and toast notification systemsfeat: add command palette with fuzzy searchfeat: add terminal launcher and clipboard supportfeat: add loop enhancements, state hooks, and event typesfeat: integrate features into app, components, and CLIdocs: update documentation and configuration