GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(web): Mod+B toggles bold at a collapsed cursor when the sidebar toggle is remapped by juliusmarminge · Pull Request #29445 · pingdotgg/t3code

fix(web): Mod+B toggles bold at a collapsed cursor when the sidebar toggle is remapped #29445

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.

Sign up for GitHub

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

Merged
juliusmarminge merged 13 commits into main from fix/issue-29426
Nov 12, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

fix(web): Mod+B toggles bold at a collapsed cursor when the sidebar toggle is remapped #29445

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit Hold shift + click to select a range
c2d05b5
test(web): reproduce #29426 collapsed Mod+B not toggling bold
juliusmarminge Nov 2, 2026
927f136
fix(web): Mod+B bolds at a collapsed cursor when the sidebar toggle i…
juliusmarminge Nov 2, 2026
12da0bf
test(web): collapsed Mod+B also toggles bold back off
juliusmarminge Nov 2, 2026
af6ba98
Merge remote-tracking branch 'origin/main' into fix/issue-29426
juliusmarminge Nov 2, 2026
68e2df5
Merge remote-tracking branch 'origin/main' into fix/issue-29426
juliusmarminge Nov 10, 2026
0548ca0
fix(web): Mod+B and Mod+I toggle at a collapsed caret inside shown Ma…
juliusmarminge Nov 10, 2026
1ba5ee5
fix(web): style shortcuts inside a shown bold word nest again
juliusmarminge Nov 11, 2026
238091e
fix(web): style shortcuts next to a shown styled word apply again
juliusmarminge Nov 11, 2026
b9da116
Merge remote-tracking branch 'origin/main' into fix/issue-29426
juliusmarminge Nov 11, 2026
7e5d328
test(web): drop repeated Mod+key nesting rows
juliusmarminge Nov 11, 2026
d1c9d05
Merge remote-tracking branch 'origin/main' into fix/issue-29426
juliusmarminge Nov 11, 2026
68caab0
Merge branch 'main' into fix/issue-29426
juliusmarminge Nov 11, 2026
da8b82a
Merge remote-tracking branch 'origin/main' into fix/issue-29426
juliusmarminge Nov 11, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/main' into fix/issue-29426
# Conflicts:
#	apps/web/src/components/ComposerPromptEditorTiptap.input.browser.test.tsx
#	apps/web/src/components/ComposerPromptEditorTiptap.tsx
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
juliusmarminge committed Nov 10, 2026
commit 68e2df532fb56bcbff1540fa9a2db30dcb226ec3

There are no files selected for viewing

86 changes: 72 additions & 14 deletions 86 apps/web/src/components/ComposerPromptEditorTiptap.input.browser.test.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -151,29 +151,87 @@ it.each([
expect(textWithMark(editor, "code")).toEqual(code);
});

it("bolds with Mod+B at a collapsed cursor and over a selection", async () => {
it.each([
{ mark: "bold", key: "b", marker: "**" },
{ mark: "italic", key: "i", marker: "*" },
])("toggles $mark with Mod+$key at a collapsed cursor", async ({ mark, key, marker }) => {
await using screen = await mountEditor("ship it");
const { editor } = screen;
const modB = isMacPlatform(navigator.platform) ? "{Meta>}b{/Meta}" : "{Control>}b{/Control}";
const mod = isMacPlatform(navigator.platform) ? "Meta" : "Control";
const chord = `{${mod}>}${key}{/${mod}}`;
await act(async () => {
editor.commands.focus("end");
});
await vi.waitFor(() => expect(document.activeElement).toBe(editor.view.dom));
await userEvent.keyboard(modB);
await userEvent.keyboard(" now");
await vi.waitFor(() => expect(textWithMark(editor, "bold")).toEqual([" now"]));
await userEvent.keyboard(modB);
await userEvent.keyboard(" ");
await userEvent.keyboard(chord);
await userEvent.keyboard("now");
await userEvent.keyboard(chord);
await userEvent.keyboard(" done");
await vi.waitFor(() => expect(editor.getText()).toBe("ship it now done"));
expect(textWithMark(editor, "bold")).toEqual([" now"]);

await act(async () => {
editor.commands.setTextSelection({ from: 1, to: 5 });
});
await userEvent.keyboard(modB);
await vi.waitFor(() => expect(textWithMark(editor, "bold")).toEqual(["ship", " now"]));
await vi.waitFor(() =>
expect(serializeEditorDoc(editor.state.doc).value).toBe(`ship it ${marker}now${marker} done`),
);
expect(textWithMark(editor, mark)).toEqual(["now"]);
});

it.each([
{ word: "ship", prefix: "", source: ["**ship**"] },
{ word: "path\\", prefix: "", source: [] },
{ word: "2*3", prefix: "", source: [] },
{ word: "b", prefix: "*", source: [] },
{ word: "word", prefix: "\\\\*", source: [] },
{ word: "word", prefix: "\\\\**", source: [] },
{ word: "word", prefix: "\\", source: [] },
{ word: "word", prefix: "\\\\", source: ["**word**"] },
{ word: "word", prefix: "\\\\\\", source: [] },
{
word: "word",
prefix: "`path\\`",
prefixText: "path\\",
source: ["**word**"],
code: ["path\\"],
},
])(
"bolds $word after '$prefix' with Mod+B over a selection",
async ({ word, prefix, prefixText = prefix, source, code = [] }) => {
const value = `${prefix}${word} it`;
await using screen = await mountEditor(value);
const { editor } = screen;
const modB = isMacPlatform(navigator.platform) ? "{Meta>}b{/Meta}" : "{Control>}b{/Control}";
await act(async () => {
editor.commands.focus("end");
});
await vi.waitFor(() => expect(document.activeElement).toBe(editor.view.dom));
await act(async () => {
editor.commands.setTextSelection({
from: prefixText.length + 1,
to: prefixText.length + word.length + 1,
});
});
await userEvent.keyboard(modB);
await vi.waitFor(() =>
expect(serializeEditorDoc(editor.state.doc).value).toBe(`${prefix}**${word}** it`),
);
expect(textWithMark(editor, "markdownSource")).toEqual(source);
const depth = undoDepth(editor.state);
await userEvent.keyboard("{End}");
expect(serializeEditorDoc(editor.state.doc).value).toBe(`${prefix}**${word}** it`);
expect(textWithMark(editor, "bold")).toEqual([word]);
expect(textWithMark(editor, "code")).toEqual(code);
expect(undoDepth(editor.state)).toBe(depth);
await act(async () => {
editor.commands.setTextSelection({
from: prefixText.length + 1,
to: prefixText.length + word.length + 1,
});
});

// Whether the selection spans shown markers or not, Mod+B removes the bold.
await userEvent.keyboard(modB);
await vi.waitFor(() => expect(serializeEditorDoc(editor.state.doc).value).toBe(value));
},
);

it.each([false, true])(
"composes an umlaut without wrapping the preedit text (rich text: %s)",
async (richTextEnabled) => {
Expand Down
2 changes: 1 addition & 1 deletion 2 apps/web/src/components/ComposerPromptEditorTiptap.tsx
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ import {
ComposerCodeBlockExtension,
ComposerListExtensions,
buildTiptapContent,
caretTakesMarksBefore,
convertBulletItemToTask,
ComposerCodeExtension,
ComposerBoldExtension,
Expand Down Expand Up @@ -820,6 +819,7 @@ function createComposerExtensions(richText: boolean) {
ComposerChipSelectionExtension,
...(richText
? [
ComposerMarkdownSourceExtension,
ComposerItalicExtension,
ComposerBoldExtension,
ComposerStrikeExtension,
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
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.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.