-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(nesting): column widths, draggable rows inside columns, and a collapsed state #2248
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
Draft
bimsonz
wants to merge
5
commits into
emdash-cms:main
Choose a base branch
from
bimsonz:feat/nesting-column-widths
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
bb35558
feat: Nesting block prototype
louisescher 1db24ba
feat(nesting): column width ratios, and rows inside columns
bimsonz 5e27736
feat(nesting): let a container be folded away
bimsonz b075b51
chore: changeset for the nesting additions
bimsonz da43fca
fix(nesting): pluralize the collapsed summary, trim comments
bimsonz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@emdash-cms/admin": minor | ||
| "emdash": minor | ||
| --- | ||
|
|
||
| Nesting blocks gain column width ratios, so a container can express a content and sidebar layout rather than only equal columns. Blocks inside a column become first-class rows that can be reordered by dragging, and a container can be folded away to a one line summary of what it holds. |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ | |
|
|
||
| import { Button } from "@cloudflare/kumo"; | ||
| import { useLingui } from "@lingui/react/macro"; | ||
| import { BracketsAngle, DotsSixVertical, Trash } from "@phosphor-icons/react"; | ||
| import { BracketsAngle, Trash } from "@phosphor-icons/react"; | ||
| import { Node, mergeAttributes } from "@tiptap/core"; | ||
| import type { NodeViewProps } from "@tiptap/react"; | ||
| import { ReactNodeViewRenderer, NodeViewWrapper } from "@tiptap/react"; | ||
|
|
@@ -86,17 +86,6 @@ function HtmlBlockNodeView({ node, updateAttributes, selected, deleteNode }: Nod | |
| data-drag-handle | ||
| > | ||
| <div className="relative group"> | ||
|
Comment on lines
87
to
88
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [needs fixing] This JSX comment explains why a duplicate grip was removed. That context belongs in the commit message/PR description, not in a code comment. Delete the block. |
||
| {/* Drag handle */} | ||
| <div | ||
| className={cn( | ||
| "absolute -start-8 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity cursor-grab active:cursor-grabbing", | ||
| selected && "opacity-100", | ||
| )} | ||
| data-drag-handle | ||
| > | ||
| <DotsSixVertical className="h-5 w-5 text-kumo-subtle/50" /> | ||
| </div> | ||
|
|
||
| {/* Main block */} | ||
| <div | ||
| className={cn( | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
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.
[needs fixing] This oversized doc block for
_rowsOnlyRuleis addressed to the reviewer (‘that is a choice about units, not a claim that they are wrong’, ‘If you would rather keep your unit…’, ‘Nothing the defaults guard is lost…’). Per AGENTS.md, comments should not justify decisions, narrate rejected alternatives, or address whoever is reviewing. The behavior is already asserted by the unit tests.Replace it with a short rationale for future readers: