Skip to content

Rkadakia/reci3 - #203

Closed
riyakadakia wants to merge 4 commits into
CMU-313:mainfrom
riyakadakia:rkadakia/reci3
Closed

riyakadakia wants to merge 4 commits into
CMU-313:mainfrom
riyakadakia:rkadakia/reci3

Conversation

@riyakadakia

@riyakadakia riyakadakia commented Sep 14, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #200

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a /scotty slash command to the OpenCode TUI that displays ASCII art of a cute Scottish terrier when invoked by the user.
Changes made:

  • Added scottyAsciiArt constant with ASCII art representation of Scotty
  • Added prompt.scotty command to the promptCommands array in packages/tui/src/component/prompt/index.tsx
  • Command inserts the ASCII art into the prompt input when /scotty is typed and executed

Why this works:
OpenCode's slash commands are defined in promptCommands with a slashName property. The autocomplete system recognizes commands with slashName and makes them available as /[slashName]. When executed, the run function inserts the ASCII art into the input field using input.insertText().

How did you verify your code works?

  1. Built the project with npm run build
  2. Ran the dev server with npm run dev
  3. Opened the OpenCode TUI
  4. Typed /scotty in the prompt
  5. Pressed Enter and verified the ASCII art appeared in the prompt input

If this is a UI change, please include a screenshot or recording.
Screenshot 2026-09-14 at 3 09 41 PM
Screenshot 2026-09-14 at 3 09 45 PM

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…ndling logic from the main component into reusable modules. - Extract mention state management into useMentionHandler custom hook, removing complex state logic from the component and making it reusable across other components that need mention functionality. - Extract pure utility functions (extractMentionQuery, insertMention) into mention-utils.ts, separating business logic from UI concerns and making the logic easier to test and maintain. - Simplify LineCommentEditorV2 component from ~200 lines to ~100 lines, focusing it solely on rendering and event handling with no impact to public API or component behavior.
Add 7 new unit tests to mention-utils.test.ts covering mention extraction,
insertion, and cursor positioning logic. Achieve 100% code coverage on the
utilities module, ensuring the core refactored logic works correctly and
preventing future regressions.
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.

2 participants