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

[Bug]: When maximizing a non-focused block, the block border is set incorrectly. #1625

Open
1 of 3 tasks
ZLATAN628 opened this issue Dec 25, 2024 · 6 comments
Open
1 of 3 tasks
Labels
bug Something isn't working triage Needs triage

Comments

@ZLATAN628
Copy link

Current Behavior

When I maximize a non-focused block, the block border is set incorrectly. I tried debugging the source code to find the answer and discovered that the width and height are first assigned the correct values but are then updated back to their original values.

image

Expected Behavior

image

Steps To Reproduce

Clicking the maximize button on the non-focused block

Wave Version

main

Platform

macOS

OS Version/Distribution

macos

Architecture

arm64

Anything else?

No response

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later
@ZLATAN628 ZLATAN628 added bug Something isn't working triage Needs triage labels Dec 25, 2024
@esimkowitz
Copy link
Member

esimkowitz commented Dec 26, 2024

I'm not able to reproduce this, could you record a video? Also how are you magnifying the block, using the context menu item or the button in the block header? You mention that the block is not focused, but either of these methods for magnifying the block should focus it first so a video would really help understand what's happening.

Also is this only in the dev version where you see this or also in the release version? Also do you notice this with all the widgets or just the web widget? Sorry for all the questions 😅

@ZLATAN628
Copy link
Author

Hi @esimkowitz ,Please watch this video. I have tried the latest release and dev versions and this problem exists in all widget.

QQ20241227-081306-HD.1.mp4

@esimkowitz
Copy link
Member

That's so strange, this does not reproduce on my system...

@ZLATAN628
Copy link
Author

I am not very good at front-end. I found that the event of updating the window size is triggered twice. The first one should be triggered by the focus event, so it enters the setInnerRectDebounced delayed update, and the second one is triggered by maximizing the window, but it is directly updated immediately here. So the performance is that after maximizing the window, it is normal at first, and then because of the delayed update, it is updated back to the window size before maximization.
GoLand 2024-12-27 08 29 55

QQ20241227-083529-HD.1.mp4

@esimkowitz
Copy link
Member

Ahhh yes that makes sense. We should cancel the denounced update when a newer one comes in

ZLATAN628 added a commit to ZLATAN628/waveterm that referenced this issue Jan 10, 2025
@ZLATAN628
Copy link
Author

Hi @esimkowitz , I believe I’ve identified the issue. During the maximize update, clearInnerRectDebounce tries to clear the previously set timeout update event. However, it fails to retrieve the timeout event, so it doesn’t get cleared, which causes the timeout event to still trigger. I have created a PR #1702 that uses a global Map to address this issue.

09F7E849DF801AA7EC00264675787127

22D938B1259FD12309B1DF8C870638EE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Needs triage
Projects
None yet
Development

No branches or pull requests

2 participants