-
Notifications
You must be signed in to change notification settings - Fork 97
Fix: Prevent tray buttons from showing active state when collapsed #754
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
base: master
Are you sure you want to change the base?
Conversation
- Removed auto-setting of trayDetail in _mouseDown handler - Removed auto-switch logic in activeGizmo observer - Set trayDetail to 'no-active-tray' when tray is collapsed - Buttons now only show active when tray is open and selected
|
@justbycris is attempting to deploy a commit to the HAXTheWeb Team on Vercel. A member of the Team first needs to authorize it. |
|
All contributors have signed the CLA. Thank you! |
|
I have read the CLA Document and I hereby sign the CLA |
|
appreciate the work here. I think you are a bit beyond the scope of the original issue:
I do think that this provides a solution to toggle off the button as far as active state color wise. |
…ode in hax-body - Restored auto-switching to settings widget when clicking new activeNodes - Kept manual button toggle fix for active state control
|
Hey @btopro,
The changes now preserve the existing UX while keeping the toggle buttons on/off functionality. |
elements/hax-body/lib/hax-tray.js
Outdated
| !["content-map", "content-edit", "content-add"].includes( | ||
| this.trayDetail, | ||
| ) | ||
| ["content-map", "content-edit", "content-add"].includes(this.trayDetail) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happens if its set to nothing? should it then set to the none for the tray detail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right! Restored the original activeGizmo logic (including the ! operator and else block) to preserve the default auto-active state behavior in the configure button when clicking elements.
| } else { | ||
| HAXStore.haxTray.collapsed = false; | ||
| // Clear active state when exiting out of collapsed tray | ||
| if (HAXStore.haxTray.collapsed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if collapsed wont this then set the color still on the content-edit tab as opposed to nothing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, as long as there's an activeNode while the menu is collapsed, the configure button will remain active (skyBlue color).
I didn't find a way to deselect an activeNode once it's selected. Is this the expected behavior? If activeNode should persist until another element is clicked, then the button staying active makes sense but let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so it's still activeNode in hax-body, it just shouldn't highlight a button if anything is collapsed. So if we've collapsed the tray then no matter what was active is now collapsed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I am confused. I thought you meant here that when clicking on a new item on the hax-body, we wanted to switch to the settings widget so the user can see what's active? see comment here --> #754 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.


Problem
Tray buttons (content-edit, content-map, content-add) were showing as active even when the tray was collapsed. This happened because clicking on body elements automatically set
trayDetail = "content-edit".Solution
trayDetailin_mouseDownhandler (hax-body.js line 775)activeGizmoobserver in updated() methodtrayDetail = 'no-active-tray'instead of nullTesting Done