waveterm icon indicating copy to clipboard operation
waveterm copied to clipboard

Feature/auto hide tab bar

Open rritik772 opened this issue 11 months ago β€’ 8 comments

This PR adds a new feature of auto hiding tab bar. Requires restart for change

Issue #1525

"window:autohidetabsbar": false

https://github.com/user-attachments/assets/a866f5ae-ba29-4e2a-a902-0fa8bd8e07f6

"window:autohidetabsbar": true

https://github.com/user-attachments/assets/0a9d4b81-71fa-4fd9-850c-ec63b1761a8d

rritik772 avatar Dec 15 '24 12:12 rritik772

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Dec 15 '24 12:12 CLAassistant

I also see that there's a discrepancy with the CLA, the email you use for your commits is not attached to your GitHub account. Can you please remedy this? Like many projects, we require all contributors to sign our Contributor License Agreement to protect us from future legal issues. It's fairly standard, however I'd recommend reading it before signing. Let me know if you have any questions.

esimkowitz avatar Dec 16 '24 06:12 esimkowitz

There is some CLA issue from my side as I cannot update author directly without interfering the the old email id. I will do the changes as requested, and open up a new pull request. Tagging this conversation.

Thanks

Edit: I was able to update the author's CLA, now this conversation can carry on. I will push changes in some time(not days)

rritik772 avatar Dec 16 '24 07:12 rritik772

I reran the check, looks like your force push fixed it :)

esimkowitz avatar Dec 16 '24 08:12 esimkowitz

hmm I think there's a bit more work to do here for macOS compatibility. We should probably hide the window controls buttons when the tabbar is hidden: image

I also think the bottom of the tabbar needs a border

esimkowitz avatar Dec 16 '24 22:12 esimkowitz

Also I think you need the onmouseenter div to be separate from the tabbarwrapper div, since the onmouseenter only gets triggered over the content of the div

https://github.com/user-attachments/assets/b5c59765-136a-4316-9cff-af033c04003b

esimkowitz avatar Dec 16 '24 23:12 esimkowitz

hmm I think there's a bit more work to do here for macOS compatibility. We should probably hide the window controls buttons when the tabbar is hidden: image

I also think the bottom of the tabbar needs a border

Also I think you need the onmouseenter div to be separate from the tabbarwrapper div, since the onmouseenter only gets triggered over the content of the div Screen.Recording.2024-12-16.at.3.08.09.PM.mov

For both problems, I guess I will need a Mac machine because I cannot replicate the issue on either Ubuntu GNOME or i3wm. You can see in the video. As of now I don’t have a Mac machine; let me arrange one.

https://github.com/user-attachments/assets/3329e8d7-edd9-4406-94ff-3578d084a9f2

rritik772 avatar Dec 17 '24 02:12 rritik772

Walkthrough

This pull request introduces a new configuration feature that allows the tab bar in the application to automatically hide based on user interaction. The key addition is the boolean configuration window:autohidetabbar, which enables this functionality. The changes are implemented across multiple files, affecting both frontend and backend components. Documentation for the new configuration key is provided, along with updates to the type definitions to incorporate the new setting. Styling modifications include the addition of new CSS classes to manage the visibility of the tab bar and adjustments to existing styles to accommodate the new behavior. The TabBar component is updated to include state management and event handling for the auto-hide feature, while the block frame and related components are modified to support the draggable functionality associated with the tab bar. Overall, the changes enhance the user interface by providing a more dynamic and responsive tab bar experience.

Changes

File Change Summary
docs/docs/config.mdx Added documentation for new window:autohidetabbar configuration key
frontend/types/gotypes.d.ts Added optional window:autohidetabbar boolean property to SettingsType
pkg/wconfig/metaconsts.go Added new constant ConfigKey_WindowAutoHideTabBar
pkg/wconfig/settingsconfig.go Added WindowAutoHideTabBar boolean field to SettingsType struct
frontend/app/tab/tabbar.tsx Implemented auto-hide logic with new state and event handlers
frontend/app/tab/tabbar.scss Added new styling classes for auto-hide tab bar behavior
frontend/app/block/block.scss Added import for tabbar.scss and used new indent variable
frontend/app/block/blockframe.tsx Added WindowDrag component and related references

Sequence Diagram

sequenceDiagram
    participant User
    participant TabBar
    participant Settings
    
    User->>Settings: Toggle window:autohidetabbar
    Settings->>TabBar: Update auto-hide setting
    TabBar->>TabBar: Apply visibility logic
    User->>TabBar: Move mouse near top
    TabBar->>TabBar: Show/hide based on setting

Poem

🐰 A Rabbit's Ode to Tab Bar Hide

Whiskers twitch, a setting so neat,
Tab bar dancing to my mouse's beat.
Hide and seek, a playful delight,
Configuration made oh-so right!
Hop along, interface so fine πŸ–₯️


πŸ“œ Recent review details

Configuration used: CodeRabbit UI Review profile: CHILL Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 73204209ab87c60d3fdab7094eabce345adc1ad9 and 2af5c024f0e078bef659cfe4e6b28daa01545ebb.

πŸ“’ Files selected for processing (4)
  • docs/docs/config.mdx (1 hunks)
  • frontend/types/gotypes.d.ts (1 hunks)
  • pkg/wconfig/metaconsts.go (1 hunks)
  • pkg/wconfig/settingsconfig.go (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • pkg/wconfig/metaconsts.go
  • frontend/types/gotypes.d.ts
  • pkg/wconfig/settingsconfig.go
  • docs/docs/config.mdx

πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Dec 19 '24 14:12 coderabbitai[bot]

closed due to age

sawka avatar Nov 25 '25 17:11 sawka