Skip to content
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

Add support for renaming a tab #63

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

atinylittleshell
Copy link
Owner

@atinylittleshell atinylittleshell commented Aug 8, 2024

Add support for renaming tabs in the terminal application.

  • State Management:

    • Add a new state variable tabTitles in packages/terminal/app/page.tsx to store tab names.
    • Modify the createTab function to initialize the tab name.
    • Modify the closeTab function to remove the tab name.
    • Pass the tabName prop to the Tab component.
  • Tab Component:

    • Accept a tabName prop in packages/terminal/components/Tab/index.tsx.
    • Display the tabName in the tab.
    • Add an input field to allow users to rename the tab.
    • Handle the input change event to update the tab name.
  • TitleBar Component:

    • Update the title bar in packages/terminal/components/TitleBar/index.tsx to reflect the renamed tab.
    • Use the tabName prop to display the tab name in the title bar.
  • TabContext:

    • Add a function to handle tab renaming in packages/terminal/hooks/TabContext.tsx.
    • Update the context to include the tab renaming function.

For more details, open the Copilot Workspace session.

Add support for renaming tabs in the terminal application.

* **State Management:**
  - Add a new state variable `tabTitles` in `packages/terminal/app/page.tsx` to store tab names.
  - Modify the `createTab` function to initialize the tab name.
  - Modify the `closeTab` function to remove the tab name.
  - Pass the `tabName` prop to the `Tab` component.

* **Tab Component:**
  - Accept a `tabName` prop in `packages/terminal/components/Tab/index.tsx`.
  - Display the `tabName` in the tab.
  - Add an input field to allow users to rename the tab.
  - Handle the input change event to update the tab name.

* **TitleBar Component:**
  - Update the title bar in `packages/terminal/components/TitleBar/index.tsx` to reflect the renamed tab.
  - Use the `tabName` prop to display the tab name in the title bar.

* **TabContext:**
  - Add a function to handle tab renaming in `packages/terminal/hooks/TabContext.tsx`.
  - Update the context to include the tab renaming function.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/atinylittleshell/TerminalOne?shareId=XXXX-XXXX-XXXX-XXXX).
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