Skip to content

Conversation

hotzenklotz
Copy link
Member

@hotzenklotz hotzenklotz commented Jan 17, 2025

This PR fixes an issue with incorrect mouse input handlers in Safari. Some FlexLayout functionalities did not work correctly in Safari:

  • minimize/maximize viewport/tab button
  • grab/drag to reposition a tab

The FlexLayout horizontal splitter "overlaid" the tab header preventing all mouse interactions (or more precisely all mouse inputs started the window/tab resizing - caused by the splitter's event handler).

This regression was likely caused by an update to FlexLayout in the past when they renamed some of their CSS classes which we did not update in our overwrites correctly.

Tested with Safari 18.1.1, Chrome 131.0.6778.86 and Firefox 134.0.1.

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • Open any dataset
  • Make sure that you can maximize the 3D viewport
  • Make sure that can reposition the 3D/XZ viewport
  • Make sure that custom, split layouts in the right sidebar can be resized, repositioned, min/maxed...

Issues:


(Please delete unneeded items, merge only when none are left open)

@hotzenklotz hotzenklotz self-assigned this Jan 17, 2025
Copy link
Contributor

coderabbitai bot commented Jan 17, 2025

📝 Walkthrough

Walkthrough

The pull request introduces various improvements to the WEBKNOSSOS frontend, focusing on UI enhancements, styling updates, and bug fixes. The changes primarily target the flex layout styling, addressing viewport interactions, tab styling, and splitter behaviors. Specifically, new CSS classes were added to improve the visual and interactive aspects of the application's layout, with particular attention to Safari-specific viewport maximization issues.

Changes

File Change Summary
frontend/stylesheets/flex_layout_overwrites.less - Added new CSS classes for tab borders and tabset styling
- Updated splitter and tab button hover states
- Modified pointer event handling for splitters

Assessment against linked issues

Objective Addressed Explanation
Maximize viewport button not selectable in Safari [#8331]

Possibly related PRs

Suggested labels

bug, css

Suggested reviewers

  • philippotto

Poem

🐰 In the realm of flex and style,
A rabbit's code hops with a smile,
Splitters dance, tabs gleam bright,
Safari's woes now take flight,
Coding magic, pixel-perfect mile! 🖥️


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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

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.

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

lgtm 👍

@hotzenklotz hotzenklotz marked this pull request as ready for review January 17, 2025 14:38
@hotzenklotz hotzenklotz enabled auto-merge (squash) January 17, 2025 14:38
@hotzenklotz hotzenklotz added the css Something frontend styling related label Jan 17, 2025
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)
frontend/stylesheets/flex_layout_overwrites.less (1)

Line range hint 31-61: LGTM! Consider documenting the z-index value.

The changes effectively address the Safari viewport issue by:

  1. Using z-index to control stacking order
  2. Implementing transparent pseudo-elements to increase click targets
  3. Properly positioning pseudo-elements for both vertical and horizontal splitters

Consider adding a comment explaining why z-index: 21 was chosen to help future maintainers understand its relationship with other z-index values in the application.

CHANGELOG.unreleased.md (1)

55-55: Consider adding more detail to the changelog entry.

While the entry correctly describes the fix, it could be more helpful to future readers by mentioning the root cause (FlexLayout splitter overlay issue) and the affected browsers (Safari 18.1.1+).

-Fixed an issue where you could not maximize or reposition the 3D/XZ viewport in Safari. [#8337](https://github.com/scalableminds/webknossos/pull/8337)
+Fixed an issue where you could not maximize or reposition the 3D/XZ viewport in Safari (18.1.1+) due to FlexLayout splitter overlaying the tab header. [#8337](https://github.com/scalableminds/webknossos/pull/8337)
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a04bca6 and b8e33e2.

📒 Files selected for processing (2)
  • CHANGELOG.unreleased.md (1 hunks)
  • frontend/stylesheets/flex_layout_overwrites.less (6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: circleci_build
🔇 Additional comments (3)
frontend/stylesheets/flex_layout_overwrites.less (3)

65-69: LGTM! Z-index hierarchy properly established.

The z-index: 100 ensures the tab bar remains above the splitter (z-index: 21), fixing both the viewport button clickability and tab repositioning in Safari.


Line range hint 96-126: LGTM! Consistent use of design system variables.

The tab button styling changes maintain visual consistency while improving user feedback through hover states and selected states.


150-154: LGTM! Splitter interaction behavior properly maintained.

The selector changes correctly maintain the intended behavior where the first splitter is non-interactive while subsequent splitters remain interactive.

@hotzenklotz hotzenklotz merged commit ec79b53 into master Jan 17, 2025
3 checks passed
@hotzenklotz hotzenklotz deleted the flexlayout_maximize branch January 17, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

css Something frontend styling related frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Maximize viewport button is not selectable

2 participants