Skip to content

Conversation

@OpeOginni
Copy link
Contributor

Feature corresponding to #4714

Enables searching for text using the keybind ctrl + f, changes prompt input to a search input that then highlights any matches in the session.

Users can return back to the prompt bar by clicking esc

Users can navigate matches using the up and down key.

Idea and flow was my idea, but did use AI for some of the implementation, also for searching codebase where other functions were used such as scrolling programmatically.

further-reduced.mov

actions-user and others added 8 commits November 26, 2025 23:33
- Added a search input component to allow users to search through messages.
- Implemented logic to highlight search matches and navigate between them.
- Updated the theme syntax rules to include strikethrough styling.
- Enhanced message rendering to support search highlighting for text and markdown parts.
- Refactored match navigation logic to prevent scrolling to the same message when navigating through matches.
- Enhanced search highlighting to correctly identify and highlight query text within code blocks.
- Updated rendering of Assistant messages to include IDs for better scrolling functionality during searches.
…t get it working in Assistant Messages (markdown)
@OpeOginni
Copy link
Contributor Author

OpeOginni commented Nov 29, 2025

Its a bit of string manipulation to get the markdown highlighting working, and also had to make use of the strikethrough syntax and change that to highlight, since the parses doesn't support using == for highlighting markdown. So might consider this a rough fix. Would like to know what anyone thinks

shuv1337 added a commit to Latitudes-Dev/shuvcode that referenced this pull request Nov 30, 2025
Merge upstream PR anomalyco#4898 from OpeOginni:
- Add SearchInput component for searching through messages
- Implement match navigation with highlighting
- Add strikethrough styling in theme syntax rules
- Enable Ctrl+F keybind to toggle search mode
shuv1337 added a commit to Latitudes-Dev/shuvcode that referenced this pull request Nov 30, 2025
Merges upstream PR anomalyco#4791 which adds:
- Bash output viewer with full ANSI color support using opentui-ansi-vt
- Terminal emulation for accurate color rendering
- Page up/down and Home/End navigation in bash output viewer
- Click to view full output for truncated bash results
- Forces color output in bash commands (FORCE_COLOR=1)
- Adds initialValue prop to Prompt component for restoring drafts

Preserves our local features:
- Token tracking and context percentage display
- Search in messages (Ctrl+F) from PR anomalyco#4898
shuv1337 added a commit to Latitudes-Dev/shuvcode that referenced this pull request Nov 30, 2025
…#4900, anomalyco#4709 fixes

Merged upstream PRs:
- anomalyco#4898: Search in messages (Ctrl+F)
- anomalyco#4791: Bash output viewer with ANSI color support
- anomalyco#4900: Double Ctrl+C to exit
- anomalyco#4709: Token counting fixes for synthetic/noReply messages

Updated README for shuvcode fork project.
shuv1337 added a commit to Latitudes-Dev/shuvcode that referenced this pull request Nov 30, 2025
#65)

* feat(tui): implement search functionality in session view

- Added a search input component to allow users to search through messages.
- Implemented logic to highlight search matches and navigate between them.
- Updated the theme syntax rules to include strikethrough styling.
- Enhanced message rendering to support search highlighting for text and markdown parts.


* feat(tui): add bash output viewer with ANSI color support

Adds an bash output viewer with full ANSI color support. When bash commands
produce more than 20 lines of output, users can click to expand into a
full-screen viewer with syntax highlighting and keyboard navigation.

Key features:
- Full ANSI/VT color rendering using opentui-ansi-vt terminal emulation
- Truncated preview (20 lines) with 'Click to view full output' expansion
- Prompt text preservation when entering/exiting viewer
- Force color output in bash commands (FORCE_COLOR, CLICOLOR, TERM env vars)

Technical changes:
- Added opentui-ansi-vt dependency for terminal buffer rendering
- Added initialValue prop to Prompt component to restore draft text
- Strip ANSI codes for search to match actual text content

* limit to MAX_OUTPUT_LENGTH

* remove ANSI from model output with ptyToText

* use 120 rows for terminal output

* chore: update opentui-ansi-vt to 1.2.7

* feat(tui): add page up/down support to bash output viewer

* fix(tui): improve match navigation and search highlighting

- Refactored match navigation logic to prevent scrolling to the same message when navigating through matches.
- Enhanced search highlighting to correctly identify and highlight query text within code blocks.
- Updated rendering of Assistant messages to include IDs for better scrolling functionality during searches.

* chore(tui-search): Removed active match differenciation, since we cant get it working in Assistant Messages (markdown)

* feat: implement double Ctrl+C to exit functionality with warning toast

* fix: improve token counting for synthetic and noReply messages (PR anomalyco#4709)

Cherry-pick fix from upstream PR anomalyco#4709 by arsham:
- Use 'ignored' flag instead of 'synthetic' for accurate token counts
- Fix sentEstimate formula to prevent double-counting tool result tokens
- Add null checks in calculateToolResultTokens for safety
- Prevents exponential growth from double-counting in session totals

* docs: update README for shuvcode fork

- Add header explaining this is a fork for PR integration testing
- Include table of merged PRs with upstream status
- Preserve original opencode documentation below

* changing sidebar version display to shuvcode
@ariane-emory
Copy link
Contributor

This only seems to be half-working. Study the following screenshots: the viewport remained in the same position as I incremented it from 1 of 12 to 6 of 12, only actually repositioning to the next search result after it had been incremented to 7 of 12.
Screenshot 2025-12-04 at 12 05 54 PM
Screenshot 2025-12-04 at 12 06 53 PM
Screenshot 2025-12-04 at 12 07 01 PM

@OpeOginni
Copy link
Contributor Author

OpeOginni commented Dec 4, 2025

@ariane-emory yeah that's because they are all in the same message block I'm guessing, since the only unique part of the component we can reference to scroll to is the message in which the word appears in, yeah it's not the best.

Best thing to do is to get more ids for parts of text in a complete message block.

PS: Happy to see you using it 🙂

@ariane-emory
Copy link
Contributor

Sorry, I may not be following. What are 'all in the same message block'? While incrementing from 1 to 6, only a single instance of the search term is onscreen.

@OpeOginni
Copy link
Contributor Author

OpeOginni commented Dec 4, 2025

Ohh really, must have missunderstood then, so it shows 12, but you only see 2? Or you do see more if you scoll down but for example they all are in the same response block from either you or the model?

@ariane-emory
Copy link
Contributor

ariane-emory commented Dec 4, 2025

There are 12 instances present total, but moving to the next search item doesn't necessarily put the item on screen: there are 6 instances of the string insta in the first message, but it is a multiple-screen long message: instances 2 through 6 all occur at least 1 screen into the message.

Since the viewport remains pointed at the start of this long message, the these instances enter the viewport while incrementing the search's instance index, so I won't actually ever actually see those instances unless I manually scroll within the message. This isn't the behaviour users generally expect from a search function.

@OpeOginni
Copy link
Contributor Author

Yes I understand now, it goes with what I was saying in the other message

@ariane-emory yeah that's because they are all in the same message block I'm guessing, since the only unique part of the component we can reference to scroll to is the message in which the word appears in, yeah it's not the best.

Best thing to do is to get more ids for parts of text in a complete message block.

PS: Happy to see you using it 🙂

For now each match is connected to a message block, so we dont update the viewport until its a different message, I could tinker a bit more to find a solution.

@ariane-emory
Copy link
Contributor

@OpeOginni Your explanation for why it behaves this way does make sense, but it nonetheless does seem to violate the expectations users are likely to have: when a user selects item 2 of 12 in a search tool, they likely expect the second instance of the needle to at least be displayed somewhere on the screen.

Eager to see what solution you come up with, I'd love to have a search tool with the same usual, conventional behaviour as most other applications' search tools.

@OpeOginni
Copy link
Contributor Author

I see there is a need for it, ill surely get it done!

@OpeOginni
Copy link
Contributor Author

@ariane-emory Made an update, mostly using estimation based on the index of the word, to predict its position and determine if it is in view or not. Did some tests to the best way I can, its getting about 80% scrolls right.

Try it out and tell me how it goes?

@ariane-emory
Copy link
Contributor

@OpeOginni Sure, will do - it's already late, so I might not get to try it out tonight, but if I don't I'll certainly try it out tomorrow.

shuv1337 added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 11, 2025
This merge brings upstream changes while preserving fork-specific features:

Preserved fork features:
- PR anomalyco#4898: Search in messages (Ctrl+F)
- PR anomalyco#4791: Bash output with ANSI colors
- PR anomalyco#4900: Double Ctrl+C to exit
- PR anomalyco#4709: Live token usage during streaming
- PR anomalyco#4865: Subagents sidebar with clickable navigation
- PR anomalyco#4515: Show plugins in /status
- Fork-only: Toggle session header visibility

Resolved conflicts:
- Package versions updated to upstream v1.0.149
- Keybind type changes (cmd -> super)
- Desktop context files updated with defensive API checks
- UI components updated for new items prop signature
- input.css/tsx renamed to text-field.css/tsx

Validation:
- All typechecks pass (12/12 packages)
- All tests pass (281 passed, 1 skipped)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
opencode-agent bot added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 19, 2025
Resolved conflicts:
- script/publish.ts: kept fork version (fork-specific publishing to Latitudes-Dev/shuvcode)

Auto-merged files with upstream improvements:
- packages/opencode/src/cli/cmd/tui/routes/session/index.tsx: new dialog-subagent component
- packages/opencode/src/session/message-v2.ts: improved error handling
- packages/desktop/src/context/global-sync.tsx: added null directory guards

Preserved fork features:
- PR anomalyco#4898: Search in messages (Ctrl+F)
- PR anomalyco#4791: Bash output with ANSI
- PR anomalyco#4900: Double Ctrl+C to exit
- PR anomalyco#4709: Live token usage during streaming
- PR anomalyco#4865: Subagents sidebar with clickable navigation
- PR anomalyco#5508: Cache management command
- Glob permissions feature
- Toggle transparent background
- Desktop slash commands and share functionality
opencode-agent bot added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 19, 2025
Resolved conflicts:
- packages/opencode/src/cli/cmd/tui/routes/session/index.tsx: Merged fork search highlighting with upstream user message markdown toggle
- packages/opencode/package.json: Accept upstream v1.0.170, preserved ghostty-opentui dependency
- .github/workflows/generate.yml: Keep fork-specific workflow (better error messaging)
- script/publish.ts: Keep fork-specific publish script (shuvcode registry, contributors)
- packages/extensions/zed/extension.toml: Accept upstream v1.0.170
- All other package.json files: Accept upstream v1.0.170 versions
- bun.lock: Regenerated

Preserved fork features:
- PR anomalyco#4898: Search in messages (Ctrl+F with highlighting)
- PR anomalyco#4791: Bash output with ANSI (ghostty-opentui)
- PR anomalyco#4900: Double Ctrl+C to exit
- PR anomalyco#4709: Live token usage during streaming
- PR anomalyco#4865: Subagents sidebar with clickable navigation
- PR #fork-140: Toggle transparent background
- Fork: Toggle session header visibility
- Fork: Desktop slash commands and shell input mode
- Fork: Desktop Night Owl theme
- Fork: Desktop theme/font pickers and branding
- Fork: Share functionality for shuv.ai
- Fork: Desktop mobile responsiveness
- Fork: Desktop review pane resizing

New upstream feature integrated:
- User message markdown toggle (enable/disable markdown rendering in user messages)
opencode-agent bot added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 20, 2025
Resolved conflicts:
- packages/opencode/script/publish.ts: Keep fork-specific publishing (skip Docker), adopt upstream's .cwd() syntax

Added missing dependency:
- ghostty-opentui: Required for PR anomalyco#4791 (Bash output with ANSI) feature

Preserved fork features:
- All fork features from fork-features.json preserved
- PR anomalyco#4791 bash ANSI output
- PR anomalyco#4898 search in messages
- PR anomalyco#4900 double Ctrl+C
- PR anomalyco#4709 live token usage
- PR anomalyco#4865 subagents sidebar
- All desktop/TUI customizations
opencode-agent bot added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 20, 2025
Resolved conflicts:
- packages/opencode/script/publish.ts: Keep ours (fork-specific publishing)

Preserved fork features:
- All features from PRs anomalyco#4898, anomalyco#4791, anomalyco#4900, anomalyco#4709, anomalyco#4865, anomalyco#4515, anomalyco#5508
- Glob permissions (#ariane-emory/glob-permissions)
- Toggle transparent background (#fork-140)
- Session header visibility toggle
- Desktop slash commands and shell input mode
- Desktop Night Owl theme
- Desktop theme/font pickers, branding, inline header
- Share functionality for shuv.ai
- All other fork-specific features listed in fork-features.json
opencode-agent bot added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 20, 2025
Resolved conflicts:
- bun.lock: regenerated
- packages/opencode/package.json: version 1.0.176-1 (fork suffix)
- packages/desktop/src/context/global-sync.tsx: merged retry() with defensive array check
- packages/desktop/src/context/global-sdk.tsx: merged commented signal with fetch/throwOnError
- packages/desktop/src/pages/layout.tsx: preserved onCleanup import
- Simple version bumps: accepted upstream for all other package.json files

Preserved fork features:
- PR anomalyco#4898: Search in messages
- PR anomalyco#4791: Bash output with ANSI
- PR anomalyco#4900: Double Ctrl+C to exit
- PR anomalyco#4709: Live token usage during streaming
- PR anomalyco#4865: Subagents sidebar with clickable navigation
- PR anomalyco#4515: Show plugins in /status
- PR anomalyco#5508: Cache management command
- PR glob-permissions: Granular file permissions
- PR fork-140: Toggle transparent background
- Desktop slash commands and shell input mode
- Desktop Night Owl theme
- Desktop theme/font pickers, branding, and inline header
- Share functionality for shuv.ai infrastructure
- TUI configurable spinner styles
- TUI layout density for small terminals
opencode-agent bot added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 20, 2025
Resolved conflicts:
- Package versions: Accept upstream 1.0.179 versions for all packages
- packages/opencode/package.json: Updated version, preserved fork dependencies
- packages/desktop/src/context/global-sync.tsx: Preserved fork's defensive array check
- packages/desktop/src/pages/layout.tsx: Preserved fork's mobile responsiveness imports
- .github/workflows/publish.yml: Keep fork-specific workflow config
- packages/extensions/zed/extension.toml: Accept upstream version URLs
- bun.lock: Regenerated from clean install

Preserved fork features:
- PR anomalyco#4898: Search in messages
- PR anomalyco#4791: Bash output with ANSI
- PR anomalyco#4900: Double Ctrl+C to exit
- PR anomalyco#4709: Live token usage during streaming
- PR anomalyco#4865: Subagents sidebar with clickable navigation
- PR anomalyco#4515: Show plugins in /status
- PR anomalyco#5508: Cache management command
- PR #ariane-emory/glob-permissions: Granular File Permissions
- PR #fork-140: Toggle transparent background
- Fork-only: Desktop theme/font pickers, branding, mobile responsiveness
- Fork-only: Share functionality for shuv.ai infrastructure
- Fork-only: TUI configurable spinners and layout density
opencode-agent bot added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 21, 2025
Resolved conflicts:
- bun.lock: accepted upstream version
- packages/console/*/package.json: accepted upstream versions
- packages/desktop/package.json: accepted upstream version
- packages/enterprise/package.json: accepted upstream version
- packages/extensions/zed/extension.toml: accepted upstream version
- packages/function/package.json: accepted upstream version
- packages/plugin/package.json: accepted upstream version
- packages/sdk/js/package.json: accepted upstream version
- packages/slack/package.json: accepted upstream version
- packages/tauri/package.json: accepted upstream version
- packages/ui/package.json: accepted upstream version
- packages/util/package.json: accepted upstream version
- packages/web/package.json: accepted upstream version
- sdks/vscode/package.json: accepted upstream version
- packages/opencode/package.json: merged (version 1.0.181-1)
- packages/opencode/src/agent/agent.ts: merged fork features (minimatch, resolveFilePermission) with upstream (Log)
- packages/opencode/src/session/prompt.ts: merged fork features (plugin commands) with upstream (Agent.defaultAgent)
- packages/desktop/src/context/layout.tsx: merged fork features (review pane) with upstream (session pane)
- packages/desktop/src/pages/session.tsx: kept fork version (mobile responsiveness, image preview, share commands)

Preserved fork features:
- PR anomalyco#4898: Search in messages
- PR anomalyco#4791: Bash output with ANSI
- PR anomalyco#4900: Double Ctrl+C to exit
- PR anomalyco#4709: Live token usage during streaming
- PR anomalyco#4865: Subagents sidebar
- PR anomalyco#4515: Show plugins in /status
- PR anomalyco#5508: Cache management command
- PR ariane-emory/glob-permissions: Granular file permissions
- PR fork-140: Toggle transparent background
- Desktop theme/font pickers and shuvcode branding
- Desktop review pane resizing and share commands
- Desktop mobile viewport fixes
- Desktop image preview in file viewer
- Shell command cwd fix for new projects
- TUI configurable spinners and layout density
shuv1337 added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 24, 2025
Resolved conflicts by keeping fork-specific features:
- PR anomalyco#5968 small screen styling (reverted upstream, preserved here)
- Search in messages (PR anomalyco#4898)
- Draggable sidebar resize (PR anomalyco#5917)
- AskQuestion tool (PR anomalyco#5958)
- IDE integration
- Bash output viewer with ANSI (PR anomalyco#4791)
- Mobile PWA support
- Share infrastructure for shuv.ai

Merged upstream improvements:
- review.toggle command with mod+shift+r keybind
- Title tag for share pages
- Session navigation and sorting improvements
- Various docs and CI updates
- Provider updates (Cloudflare AI Gateway)
- MCP tools/list_changed notifications
- Prompt stashing feature
- Did you know tips on start screen
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.

3 participants