Skip to content

Some editor nits and updates#873

Merged
mdo merged 21 commits into
beta-1.3from
mdo/editor-nits
Jun 24, 2026
Merged

Some editor nits and updates#873
mdo merged 21 commits into
beta-1.3from
mdo/editor-nits

Conversation

@mdo

@mdo mdo commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Copy edits, design updates, and more.

@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pierre-docs-diffs Ready Ready Preview Jun 24, 2026 8:27pm
pierre-docs-diffshub Ready Ready Preview Jun 24, 2026 8:27pm
pierre-docs-trees Ready Ready Preview Jun 24, 2026 8:27pm
pierrejs-diff-demo Ready Ready Preview Jun 24, 2026 8:27pm

Request Review

@mdo
mdo requested a review from ije June 23, 2026 19:22
@mdo
mdo requested a review from necolas June 23, 2026 19:52
Comment thread packages/diffs/src/editor/editor.css
Comment thread packages/diffs/src/editor/editor.ts
Comment on lines +164 to +180
<Button
variant="outline"
className="justify-between gap-3 pr-11 pl-3"
onClick={() => setMode(mode === 'edit' ? 'review' : 'edit')}
>
<div className="flex items-center gap-2">
<IconPencil className="-ml-0.5" />
Edit mode
</div>
</Button>
<Switch
checked={mode === 'edit'}
onCheckedChange={(checked) => setMode(checked ? 'edit' : 'review')}
onClick={(e) => e.stopPropagation()}
className="pointer-events-none mr-3 place-self-center justify-self-end"
aria-label="Edit mode"
/>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the Button and Switch doing the same thing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya it's a stylistic thing—I use a CSS grid to stack the switch on the button. Not great, but fine lol. We do this in a lot of places, so we could refactor at some point.

Comment thread apps/docs/app/(diffs)/_examples/LiveEditing/LiveEditing.tsx
Comment thread apps/docs/app/(diffs)/_edit/HistoryDemo.tsx Outdated
Comment thread packages/diffs/src/editor/editor.ts Outdated
Comment thread packages/diffs/src/editor/editor.ts Outdated
@ije
ije force-pushed the mdo/editor-nits branch from af69f4b to 90f3379 Compare June 24, 2026 07:30
@socket-security

socket-security Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​pierre/​icons@​0.5.0 ⏵ 0.7.177 +110078 +297 +2100

View full report

Comment thread packages/diffs/src/style.css
@mdo
mdo merged commit 52af552 into beta-1.3 Jun 24, 2026
8 checks passed
@mdo
mdo deleted the mdo/editor-nits branch June 24, 2026 20:27
amadeus added a commit that referenced this pull request Jun 24, 2026
* chore: empty commit for beta branch

* Prevent transparent borders

* Fix the editing example

* fix cursor jumping in history demo

* wip

* updates

* button fixes, history improvement

* refactor(diffs): show the selection action in a floating popover

Selecting text in an editable surface used to surface a lightning icon
in the gutter; clicking it inserted the consumer's action element as a
new inline row, which reflowed the document and took two interactions.

Replace that with a floating popover that appears automatically once a
ranged selection settles, anchored just below the selection's head and
mounted in the overlay layer so it never reflows the content. The
`renderSelectionAction` API is unchanged, and its handlers now read the
live primary selection so keyboard-extending a selection keeps acting on
the current range. Drop the now-unused gutter icon, its `quick` sprite,
and the inline-row styling.

* docs(docs): rebuild the selection action demo as "Add to chat"

The edit page's selection demo wrapped the selection in t() or shouted
it in caps from a toolbar. Rebuild it around the new popover: selecting
code pops an indigo "Add to chat" action (plus a secondary copy) that
sends the snippet to a mock chat panel beside the editor, complete with
an inert composer mirroring the homepage agent UI.

Snippets render with a read-only File. The page's shared worker pool is
wired for the editable surface and doesn't highlight a dynamically
mounted read-only File, so opt these out with disableWorkerPool and
highlight on the main thread. The panel is height-matched to the editor
so the list scrolls while the header and composer stay put.

* docs(docs): describe the selection action popover

Update the editor docs and copy to match the new behavior: the action
appears in a floating popover anchored to the selection instead of a
gutter icon you click, and it can hold any number of actions. Refresh
the edit-page blurb, the Editor guide prose, and the option comment, and
drop the selection action from the standalone EditorDemo so it stays
focused on plain editing.

* chore(demo): match the renamed selection action popover hook

The selection action now renders as a popover, so target the new
[data-selection-action-popover] selector and drop the inline margin that
spaced the old inline action row.

* test(diffs): cover selection action popover lifecycle

Add cases for the popover's auto show/teardown: it disappears once the
selection collapses, and it never renders (nor calls the consumer's
callback) when enabledSelectionAction is left off.

* feature updates

* New replace and replaceall icons

* better search shortcuts

* Update keyboard shorcuts table

* refactor search, fix some nits, redo icons in search, combine marker severity styles

* remove labels

* use claude to restore the delta between X's and my changes, then reapply to markers and popovers

* improve focus, rearrange

* localize the padding/margin for now

---------

Co-authored-by: Amadeus Demarzi <amadeusdemarzi@gmail.com>
amadeus added a commit that referenced this pull request Jun 24, 2026
* chore: empty commit for beta branch

* Prevent transparent borders

* Fix the editing example

* fix cursor jumping in history demo

* wip

* updates

* button fixes, history improvement

* refactor(diffs): show the selection action in a floating popover

Selecting text in an editable surface used to surface a lightning icon
in the gutter; clicking it inserted the consumer's action element as a
new inline row, which reflowed the document and took two interactions.

Replace that with a floating popover that appears automatically once a
ranged selection settles, anchored just below the selection's head and
mounted in the overlay layer so it never reflows the content. The
`renderSelectionAction` API is unchanged, and its handlers now read the
live primary selection so keyboard-extending a selection keeps acting on
the current range. Drop the now-unused gutter icon, its `quick` sprite,
and the inline-row styling.

* docs(docs): rebuild the selection action demo as "Add to chat"

The edit page's selection demo wrapped the selection in t() or shouted
it in caps from a toolbar. Rebuild it around the new popover: selecting
code pops an indigo "Add to chat" action (plus a secondary copy) that
sends the snippet to a mock chat panel beside the editor, complete with
an inert composer mirroring the homepage agent UI.

Snippets render with a read-only File. The page's shared worker pool is
wired for the editable surface and doesn't highlight a dynamically
mounted read-only File, so opt these out with disableWorkerPool and
highlight on the main thread. The panel is height-matched to the editor
so the list scrolls while the header and composer stay put.

* docs(docs): describe the selection action popover

Update the editor docs and copy to match the new behavior: the action
appears in a floating popover anchored to the selection instead of a
gutter icon you click, and it can hold any number of actions. Refresh
the edit-page blurb, the Editor guide prose, and the option comment, and
drop the selection action from the standalone EditorDemo so it stays
focused on plain editing.

* chore(demo): match the renamed selection action popover hook

The selection action now renders as a popover, so target the new
[data-selection-action-popover] selector and drop the inline margin that
spaced the old inline action row.

* test(diffs): cover selection action popover lifecycle

Add cases for the popover's auto show/teardown: it disappears once the
selection collapses, and it never renders (nor calls the consumer's
callback) when enabledSelectionAction is left off.

* feature updates

* New replace and replaceall icons

* better search shortcuts

* Update keyboard shorcuts table

* refactor search, fix some nits, redo icons in search, combine marker severity styles

* remove labels

* use claude to restore the delta between X's and my changes, then reapply to markers and popovers

* improve focus, rearrange

* localize the padding/margin for now

---------

Co-authored-by: Amadeus Demarzi <amadeusdemarzi@gmail.com>
tjni pushed a commit to tjni/pierre that referenced this pull request Jun 25, 2026
* chore: empty commit for beta branch

* Prevent transparent borders

* Fix the editing example

* fix cursor jumping in history demo

* wip

* updates

* button fixes, history improvement

* refactor(diffs): show the selection action in a floating popover

Selecting text in an editable surface used to surface a lightning icon
in the gutter; clicking it inserted the consumer's action element as a
new inline row, which reflowed the document and took two interactions.

Replace that with a floating popover that appears automatically once a
ranged selection settles, anchored just below the selection's head and
mounted in the overlay layer so it never reflows the content. The
`renderSelectionAction` API is unchanged, and its handlers now read the
live primary selection so keyboard-extending a selection keeps acting on
the current range. Drop the now-unused gutter icon, its `quick` sprite,
and the inline-row styling.

* docs(docs): rebuild the selection action demo as "Add to chat"

The edit page's selection demo wrapped the selection in t() or shouted
it in caps from a toolbar. Rebuild it around the new popover: selecting
code pops an indigo "Add to chat" action (plus a secondary copy) that
sends the snippet to a mock chat panel beside the editor, complete with
an inert composer mirroring the homepage agent UI.

Snippets render with a read-only File. The page's shared worker pool is
wired for the editable surface and doesn't highlight a dynamically
mounted read-only File, so opt these out with disableWorkerPool and
highlight on the main thread. The panel is height-matched to the editor
so the list scrolls while the header and composer stay put.

* docs(docs): describe the selection action popover

Update the editor docs and copy to match the new behavior: the action
appears in a floating popover anchored to the selection instead of a
gutter icon you click, and it can hold any number of actions. Refresh
the edit-page blurb, the Editor guide prose, and the option comment, and
drop the selection action from the standalone EditorDemo so it stays
focused on plain editing.

* chore(demo): match the renamed selection action popover hook

The selection action now renders as a popover, so target the new
[data-selection-action-popover] selector and drop the inline margin that
spaced the old inline action row.

* test(diffs): cover selection action popover lifecycle

Add cases for the popover's auto show/teardown: it disappears once the
selection collapses, and it never renders (nor calls the consumer's
callback) when enabledSelectionAction is left off.

* feature updates

* New replace and replaceall icons

* better search shortcuts

* Update keyboard shorcuts table

* refactor search, fix some nits, redo icons in search, combine marker severity styles

* remove labels

* use claude to restore the delta between X's and my changes, then reapply to markers and popovers

* improve focus, rearrange

* localize the padding/margin for now

---------

Co-authored-by: Amadeus Demarzi <amadeusdemarzi@gmail.com>
amadeus added a commit that referenced this pull request Jul 21, 2026
* chore: empty commit for beta branch

* Prevent transparent borders

* Fix the editing example

* fix cursor jumping in history demo

* wip

* updates

* button fixes, history improvement

* refactor(diffs): show the selection action in a floating popover

Selecting text in an editable surface used to surface a lightning icon
in the gutter; clicking it inserted the consumer's action element as a
new inline row, which reflowed the document and took two interactions.

Replace that with a floating popover that appears automatically once a
ranged selection settles, anchored just below the selection's head and
mounted in the overlay layer so it never reflows the content. The
`renderSelectionAction` API is unchanged, and its handlers now read the
live primary selection so keyboard-extending a selection keeps acting on
the current range. Drop the now-unused gutter icon, its `quick` sprite,
and the inline-row styling.

* docs(docs): rebuild the selection action demo as "Add to chat"

The edit page's selection demo wrapped the selection in t() or shouted
it in caps from a toolbar. Rebuild it around the new popover: selecting
code pops an indigo "Add to chat" action (plus a secondary copy) that
sends the snippet to a mock chat panel beside the editor, complete with
an inert composer mirroring the homepage agent UI.

Snippets render with a read-only File. The page's shared worker pool is
wired for the editable surface and doesn't highlight a dynamically
mounted read-only File, so opt these out with disableWorkerPool and
highlight on the main thread. The panel is height-matched to the editor
so the list scrolls while the header and composer stay put.

* docs(docs): describe the selection action popover

Update the editor docs and copy to match the new behavior: the action
appears in a floating popover anchored to the selection instead of a
gutter icon you click, and it can hold any number of actions. Refresh
the edit-page blurb, the Editor guide prose, and the option comment, and
drop the selection action from the standalone EditorDemo so it stays
focused on plain editing.

* chore(demo): match the renamed selection action popover hook

The selection action now renders as a popover, so target the new
[data-selection-action-popover] selector and drop the inline margin that
spaced the old inline action row.

* test(diffs): cover selection action popover lifecycle

Add cases for the popover's auto show/teardown: it disappears once the
selection collapses, and it never renders (nor calls the consumer's
callback) when enabledSelectionAction is left off.

* feature updates

* New replace and replaceall icons

* better search shortcuts

* Update keyboard shorcuts table

* refactor search, fix some nits, redo icons in search, combine marker severity styles

* remove labels

* use claude to restore the delta between X's and my changes, then reapply to markers and popovers

* improve focus, rearrange

* localize the padding/margin for now

---------

Co-authored-by: Amadeus Demarzi <amadeusdemarzi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants