Commit Graph
10 Commits
Author SHA1 Message Date
Evan SimkowitzandGitHub fd6e92ee2c Clear previous layout when applying portable layout to tab (#382) 2024-09-16 17:26:37 -07:00
Evan SimkowitzandGitHub 9b12aa9882 Fix bug in TileLayout where computeMoveNode had stale node data (#361)
This was hard to debug. It manifested in nodes that had been collapsed
into their parent. When a node was dragged over the recently-collapsed
node, the placeholder would show the action as if the flex direction was
reversed. It turns out useDrag has trouble tracking changes to the
LayoutNode objects. For now, I am just finding the nodes again in the
computeMoveNode function. Later when I redo the drag system, I will fix
this better.
2024-09-10 17:23:28 -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 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
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 d5140129cd Fix block numbering and switching with arrow keys (#258) 2024-08-21 17:43:11 -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 fc7bb7eaca Clean up and document the layout model code (#229) 2024-08-15 12:24:06 -07:00
Evan Simkowitz 8262f977f0 remove unused layout tree reducer 2024-08-14 18:44:32 -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