Andy g6/website split view#844
Merged
Merged
Conversation
…nce the new 'layout' type
…split screening possible
… y levels: works outside of dropdown!
…of draggable item in dropdown
fix: truncate overflowing graph labels with ellipsis in dropdown items
yuekaifred
reviewed
Mar 18, 2026
Contributor
|
I'd consider limiting it to only two graphs per row, ppl don't really need four on one row and it's difficult to read the graphs when they're that narrow. Also prevents confusion with moving around the graphs. |
Contributor
|
Hi @yuekaifred @AndyG6 @minjunminji , can we have this wrapped up please? |
The `useEffect(() => rearrangeGraphs(layout), [layout])` fired on mount with the layout already in the store (it was initialized from graphs.layout), so opening the dropdown dispatched a redundant REARRANGE_GRAPHS with the existing value. Replace the effect with a commitLayout helper that the drag handlers call only when the layout actually changes. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The doc block describing splitGraph sat above moveGraphToIndex, which had its own doc immediately below it — easy to misread as belonging to the wrong function. Rewrite it to match the actual splitGraph behaviour (two-graph cap, no-op cases) and put it directly above splitGraph. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The 'full' variant of SplitSide was only applied to graphs inside an existing split group. But the pointermove logic falls through to gap detection whenever the target is in a >=2-member group, and removeGraph collapses 1-member groups back to standalone, so a split group always has exactly 2 members. The 'full' branch was therefore unreachable, as was its dropdownItemSplitTarget CSS class. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
splitGraph removed the source from the layout via removeGraph, then attempted to insert it next to the target — but if the target was already in a 2-member split group, the code returned the existing item unchanged with no fallback path, leaving the layout without the source. The 2-per-row UI gating in RearrangeGraphDropdown made this unreachable in practice, but the helper itself was wrong: any future caller (or a test) would see graphs disappear. Move the full-group check above the removeGraph call so the function returns the original layout untouched, matching the existing no-op semantics for the other guard cases. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
22 tests covering findLayoutIndex, moveGraph, moveGraphToIndex, extractGraph, and splitGraph — including the no-op cases that document the helpers' intent (source === target, same item, full target group, adjacent gaps), the split-group-as-atomic-unit semantics of moveGraph, extractGraph's standalone-vs-group dispatch, and an end-to-end invariant pass (no nested groups, no duplicates, all graphs preserved). Node 25 ships type stripping by default, so the tests run with `node --test` and need no extra deps. Two small infra tweaks make this work cleanly: - Split `GraphsLayoutHelpers.ts`'s import into `import type` for types and a value import for `isSplitGroup`, with explicit `.ts` extensions — Node ESM is extension-strict and strip-types can't elide imports without the `type` keyword. This also aligns with the project's existing `isolatedModules: true`. - Add `allowImportingTsExtensions: true` to tsconfig (safe because the project already has `noEmit: true`) so tsc accepts the explicit extensions. Add an `npm run test:graphs` script. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…view # Conflicts: # src/website/package.json
minjunminji
approved these changes
Jun 12, 2026
raghumanimehta
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

split screen feature in the layout model added!
this change allows the graphs to be displayed 2 at a time, or 3 at a time or EVEN 4 IN ONE TIME
Comprehensive technical changes (claude summary)
Introduced Layout, LayoutItem, and GraphId types in GraphsTypes.ts. A layout item is either a single GraphId or a GraphId[] (split group)
Renamed graphs.order → graphs.layout in the Redux store and session storage
Added GraphsLayoutHelpers.ts with pure layout manipulation helpers: moveGraph, moveGraphToIndex, extractGraph, and splitGraph
Replaced SortableContext/useSortable with useDraggable + a custom pointermove listener for richer drag intent detection (split vs. reorder vs. extract)
how to recreate change
-You can reorder the graphs via gap drop zones (highlighted with a blue line indicator)
-Split them alongside an existing item (left/right highlight on hover)
-Can also extract a graph out of a split group back into its own row