Skip to content

fix: terminal handle edge flipping and tab number reuse - #1911

Merged
bajrangCoder merged 1 commit into
Acode-Foundation:mainfrom
bajrangCoder:feat/terminal-handle-edge-flip-tab-number-reuse
Feb 27, 2026
Merged

bajrangCoder merged 1 commit into
Acode-Foundation:mainfrom
bajrangCoder:feat/terminal-handle-edge-flip-tab-number-reuse

Conversation

@bajrangCoder

Copy link
Copy Markdown
Member

No description provided.

@greptile-apps

greptile-apps Bot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes two terminal UX issues: terminal tab numbers now reuse available slots instead of incrementing indefinitely, and touch selection handles now flip orientation when they would appear outside the viewport.

Key Changes:

  • Added extractTerminalNumber() and getNextAvailableTerminalNumber() methods to intelligently track and reuse terminal numbers
  • Terminal instances now store their number and use a stable titlePrefix to prevent tab titles from changing unexpectedly
  • Refactored handle orientation logic into reusable methods that dynamically adjust based on viewport boundaries
  • Selection handles now flip when positioned near left/right viewport edges, ensuring they remain visible and usable

Impact:

  • Users will see cleaner terminal numbering (e.g., "Terminal 1, 2, 3" instead of "Terminal 1, 5, 8" after closing some)
  • Touch selection near screen edges is now more intuitive as handles automatically reorient themselves

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is well-structured with proper null/undefined handling, edge case coverage, and backward compatibility. Both fixes address specific UX issues without introducing breaking changes. The terminal number extraction uses a robust regex pattern, and the handle orientation logic correctly preserves existing transforms while adjusting orientation.
  • No files require special attention

Important Files Changed

Filename Overview
src/components/terminal/terminalManager.js Added terminal number extraction and reuse logic to prevent number gaps when terminals are closed; replaced counter-based naming with stable title prefixes per instance.
src/components/terminal/terminalTouchSelection.js Implemented dynamic handle orientation that flips selection handles when they would appear outside the viewport boundaries, improving UX for edge selections.

Last reviewed commit: 29c59eb

@bajrangCoder
bajrangCoder merged commit 1dc5c63 into Acode-Foundation:main Feb 27, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Feb 27, 2026
@bajrangCoder
bajrangCoder deleted the feat/terminal-handle-edge-flip-tab-number-reuse branch February 27, 2026 15:30
7HR4IZ3 pushed a commit to cyber-sight/Acode that referenced this pull request Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant