Commit Graph
14 Commits
Author SHA1 Message Date
Sylvia Crowe 5d62613fb8 fix: add async explicitly for debounce output 2024-09-19 15:59:26 -07:00
Evan SimkowitzandGitHub 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 SimkowitzandGitHub 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 SimkowitzandGitHub aab487541b Resolve BlockNum in WSH commands (#301) 2024-08-30 20:20:25 -07:00
Evan SimkowitzandGitHub 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 SimkowitzandGitHub 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 SimkowitzandGitHub c9c555452a Establish wlayout for coordinating backend layout actions (#282) 2024-08-27 18:38:57 -07:00
Evan SimkowitzandGitHub 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
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 SimkowitzandGitHub 23261a7a98 Add flag for specifying a new node as magnified on insert (#253) 2024-08-20 20:14:14 -07:00
Evan SimkowitzandGitHub bd4bf93d4a Update copyright indicators on a bunch of files (#255) 2024-08-20 17:01:29 -07:00
Evan SimkowitzandGitHub 9fa11ff838 Fix tab switching issues with layout model (#230) 2024-08-15 13:45:45 -07:00
Evan Simkowitz 3c9b3423a9 update type defs 2024-08-14 19:43:25 -07:00
Evan SimkowitzandGitHub e85b0d205e New layout model (#210)
This PR is a large refactoring of the layout code to move as much of the
layout state logic as possible into a unified model class, with atoms
and derived atoms to notify the display logic of changes. It also fixes
some latent bugs in the node resize code, significantly speeds up
response times for resizing and dragging, and sets us up to fully
replace the React-DnD library in the future.
2024-08-14 18:40:41 -07:00