Skip to content

Add setting to show tab bar at bottom #2159

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nahoj
Copy link

@nahoj nahoj commented May 3, 2025

As a user, I want the option to have the tab bar at the bottom of the window, so that when I open Wave from my task bar, I can select a tab easily because they are closer to my mouse.

Copy link
Contributor

coderabbitai bot commented May 3, 2025

Walkthrough

This change introduces support for configuring the position of the application's tab bar, allowing it to be placed either at the top or bottom of the workspace interface. A new configuration key, "window:tabbarposition", is added to the settings schema, default configuration, and relevant type declarations in both TypeScript and Go codebases. The frontend components are updated to read this setting and adjust their layout and styling accordingly: the tab bar container conditionally applies a CSS class that modifies padding, the workspace layout reverses its flex direction when the tab bar is positioned at the bottom, and the WorkspaceSwitcher component receives a new placement prop that controls its popover placement. These changes affect styling and layout without modifying event handling or core tab functionality. The only exported component signature change is the addition of the placement prop to WorkspaceSwitcher.


📜 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 bf62ec6 and a0cad67.

📒 Files selected for processing (2)
  • frontend/types/gotypes.d.ts (1 hunks)
  • schema/settings.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • schema/settings.json
  • frontend/types/gotypes.d.ts
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
schema/settings.json (1)

185-187: Add enum constraint for valid tabbar positions
Without an enum, users can set arbitrary strings, which may lead to unexpected behavior. To enforce correct usage, consider adding an

"enum": ["top", "bottom"]

constraint under the "window:tabbarposition" property.

frontend/types/gotypes.d.ts (1)

739-739: Strengthen type safety with union types
Instead of a generic string, define the property as a union of valid values—e.g.:

"window:tabbarposition"?: "top" | "bottom";

This will catch invalid settings at compile time.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0b16593 and bf62ec6.

📒 Files selected for processing (9)
  • frontend/app/tab/tabbar.scss (1 hunks)
  • frontend/app/tab/tabbar.tsx (2 hunks)
  • frontend/app/tab/workspaceswitcher.tsx (3 hunks)
  • frontend/app/workspace/workspace.tsx (1 hunks)
  • frontend/types/gotypes.d.ts (1 hunks)
  • pkg/wconfig/defaultconfig/settings.json (1 hunks)
  • pkg/wconfig/metaconsts.go (1 hunks)
  • pkg/wconfig/settingsconfig.go (1 hunks)
  • schema/settings.json (2 hunks)
🔇 Additional comments (13)
frontend/app/tab/tabbar.scss (1)

126-129: Consistent bottom padding adjustment
The reduced vertical padding for .tab-bar-wrapper.tab-bar-bottom aligns with the new bottom placement of the tab bar and complements the default top padding. Implementation is clear and correct.

pkg/wconfig/metaconsts.go (1)

78-78: Ensure constant naming consistency
The new ConfigKey_WindowTabBarPosition follows the existing naming convention and key prefix for window-related settings. It fits well among the other ConfigKey_Window* constants.

pkg/wconfig/settingsconfig.go (1)

123-123: Field integration looks correct
Adding WindowTabBarPosition *string with the proper JSON tag ("window:tabbarposition,omitempty") aligns perfectly with the new configuration key. Using a pointer differentiates between an unset value and an explicit empty string.

pkg/wconfig/defaultconfig/settings.json (1)

18-18: Good addition of the tab bar position setting.

The new setting "window:tabbarposition": "top" follows the project's naming conventions and properly establishes the default tab bar position. This enables the configurable tab bar placement feature.

frontend/app/workspace/workspace.tsx (2)

154-156: Good implementation for accessing the tab bar position setting.

The code correctly reads the settings atom to retrieve the user's tab bar position preference.


158-158: Effective use of conditional class application for layout control.

The implementation elegantly uses the clsx utility to conditionally apply the flex-col-reverse class when the tab bar position is set to bottom. This reverses the flex direction, placing the tab bar at the bottom of the workspace.

frontend/app/tab/tabbar.tsx (4)

18-18: Added required clsx import.

Properly added the clsx utility for conditional CSS class application.


652-654: Well-structured conditional logic for tab bar positioning.

The code correctly reads the tab bar position setting and sets the appropriate workspace switcher placement based on the position. When the tab bar is at the bottom, the popover should open upward (top-start), and when at the top, it should open downward (bottom-start).


662-662: Good implementation of conditional styling for tab bar position.

Correctly applies the "tab-bar-bottom" CSS class when the tab bar position is set to "bottom", which allows for specific styling adjustments in the SCSS file.


666-666: Properly updated WorkspaceSwitcher with dynamic placement.

The code now correctly passes the dynamic placement prop to the WorkspaceSwitcher component, ensuring the popover opens in the appropriate direction based on the tab bar position.

frontend/app/tab/workspaceswitcher.tsx (3)

28-30: Well-defined type for the new placement prop.

Good practice to explicitly define a type for the component props, with appropriate constraints on the placement values.


41-41: Properly updated component signature with typed props.

The component now correctly accepts and destructures the new placement prop in its forwardRef implementation.


100-100: Effectively used the placement prop for popover positioning.

The component correctly passes the placement prop to the Popover component, replacing the previously hardcoded value.

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