39 Commits

Author SHA1 Message Date
Evan Simkowitz 7c2268fb81 fix for new tab thing (#792) 2024-09-19 16:08:59 -07:00
Sylvia Crowe 466a659ef2 fix: remove debounce on setTreeStateAtomUpdated 2024-09-19 16:02:59 -07:00
Evan Simkowitz 7126c47ecc Fix missing new tab layouts (#402) 2024-09-19 12:59:09 -07:00
Evan Simkowitz 839889ba63 missed another break 2024-09-19 12:23:06 -07:00
Evan Simkowitz f14b4c6f11 missed a break 2024-09-19 12:22:23 -07:00
Evan Simkowitz fd6e92ee2c Clear previous layout when applying portable layout to tab (#382) 2024-09-16 17:26:37 -07:00
Evan Simkowitz afe73c3e85 Make the debounced node inner rect hook more reliable (#350)
Rather than try to track the transition state, which was proving
unreliable, I am just directly tracking the node state and determining
whether to debounce the inner rect based on whether the user has the
prefers-reduced-motion setting or query, whether the node is resizing,
and whether it's currently magnified. I'm then using the actual
animation time setting to determine how long to debounce.
2024-09-06 16:20:27 -07:00
Evan Simkowitz 9ef6745d66 fix regression in nodeModel.innerRect 2024-09-05 18:07:55 -07:00
Evan Simkowitz 74c8044c73 Add gap size setting (#325)
Adds a new setting for the gap size between tiles in a layout. Also
updates the resize handle calculations so they are dynamically generated
based on the gap size. Also updates the styling for the resize handles
to be more robust.

This also updates the default gap size to 3px.

This also slims out the Block Frame padding so it is just enough that
the blocks don't overlap when there's no gap.
2024-09-04 22:07:47 -07:00
Evan Simkowitz 16e1b7f65c Unmagnify the final leaf in a layout (#307)
This handles an edge case where a user deletes all unmagnified nodes,
leaving a final node that is still magnified. Because we ignore
magnify/unmagnify operations when there's only one leaf remaining, this
would result in the last node being stuck magnified until a new node is
added.

Also fixes a bug where the layout would not always update when a new
block was added.
2024-09-03 14:26:29 -07:00
Evan Simkowitz 383a71fc25 Fix infinite loop in layoutAtom, improve iconbutton disable code (#306)
Fixes an infinite loop in the layoutModel atom synchronization that
would cause the atom to update indefinitely when the root node is
deleted.

Also adds a dedicated `disabled` flag for the IconButton decl so we can
disable the onClick handler when the button is disabled.

Also updates the Magnify toggle button to use this new flag, so that
when there's only one leaf in a layout, the magnify button is disabed.
2024-09-03 11:24:45 -07:00
sawka 70ef76be62 implement cmd:i, hook up telemetry switch, fix some settings types 2024-09-02 20:21:35 -07:00
Evan Simkowitz aab487541b Resolve BlockNum in WSH commands (#301) 2024-08-30 20:20:25 -07:00
Evan Simkowitz e9b78c354f Resize handle improvements (#299)
Adds a delay to the resize handle line first showing so it doesn't flicker when the mouse briefly passes over it. Also removes an unnecessary findNode call that was happening on every move. Also adjusts the pointer offset based on the display container bounding rect.
2024-08-30 12:31:03 -07:00
Evan Simkowitz 099c196cae Use transition events to better-coordinate debouncing of NodeModel innerRect (#288)
Rather than using a timeout to debounce changes to the
NodeModel.innerRect, I'll use a transition event on the display
container. This way, if the user disables transitions using the reduced
motion setting, changes to the innerRect value will not be debounced.
2024-08-28 13:28:49 -07:00
Evan Simkowitz fb65ec1e23 Explicitly set focus on insert (#285)
Adds a flag to the insert layout action to explicitly set the focus of a
newly inserted node. This also adds a flag in the starter layout to
focus on the terminal block.
2024-08-27 23:16:07 -07:00
Evan Simkowitz c9c555452a Establish wlayout for coordinating backend layout actions (#282) 2024-08-27 18:38:57 -07:00
sawka 730c0b1eea fix nullptr for non-focused node 2024-08-27 13:45:05 -07:00
Evan Simkowitz c892c39a73 Fix block content sizing (#280)
Make the block content sizing update once when its node moves or becomes
magnified. By manually updating this inner sizing rather than letting
the block flow in the DOM, the animations of the block frames are much
smoother.

This also fixes an issue where two scrollbars were being rendered for
the Directory Preview widget.

This also sets zero padding on nodes when there's only a single node
being rendered.
2024-08-27 13:41:36 -07:00
Evan Simkowitz cefc491bf2 fix layoutNode and layout util tests 2024-08-26 16:27:57 -07:00
Evan Simkowitz eea57af80b Fix Cmd-W to close focused node (#273)
Fixes the in-memory focused node stack so it can be used to find the currently-focused node. This is necessary for `closeFocusedNode` to work.  Also fixes `validateFocusedNode` so it will set the first node to be focused if no focused node is available. Also cleans up leafOrder update pattern.
2024-08-26 12:32:28 -07:00
Evan Simkowitz 164afeeb66 Unified node model to pass data from layout to blocks (#259)
This adds a new NodeModel, which can be passed from the TileLayout to
contained blocks. It contains all the layout data that the block should
care about, including focus status, whether a drag operation is
underway, whether the node is magnified, etc.

This also adds a focus stack for the layout, which will let the focus
switch to the last-focused node when the currently-focused one is
closed.

This also addresses a regression in the resize handles that caused them
to be offset from the cursor when dragged.

---------

Co-authored-by: sawka <mike.sawka@gmail.com>
2024-08-26 11:56:00 -07:00
Evan Simkowitz d5140129cd Fix block numbering and switching with arrow keys (#258) 2024-08-21 17:43:11 -07:00
Evan Simkowitz 23261a7a98 Add flag for specifying a new node as magnified on insert (#253) 2024-08-20 20:14:14 -07:00
Evan Simkowitz bd4bf93d4a Update copyright indicators on a bunch of files (#255) 2024-08-20 17:01:29 -07:00