Skip to content
TheChatArchiveThe Chat Archive
gpt-5.6-sol· openaiHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

Untitled conversation

  1. User

    [PRO]: unsetAllMarks deletes comments

    Affected Packages

    extension-comments

    Version(s)

    2.17.5

    Description of the Bug

    Our Tiptap editor has a "clear formatting" button that calls unsetAllMarks to remove formatting from the selection.

    We noticed, however, that if the selection includes content associated with a comment, the comment is also deleted (presumably because the <span> element wrapping the content is removed).

    Is this a bug? I can see how we might want unsetAllMarks to include comments, if we consider the comment tag a "mark," but at the same time I imagine users would generally not expect unsetAllMarks to delete comments.

    For now, as a workaround, we are calling unsetMark separately for all non-comment marks, e.g.

    editor.chain().focus().unsetMark('link').unsetMark('bold').unsetMark('strike') ...
    

    ... but would be nice to be able to use unsetAllMarks again for formatting-specific marks. Thanks!

    Browser Used

    Chrome

    Code Example (Preferred)

    No response

    Expected Behavior

    unsetAllMarks will remove formatting marks (listed here) but not remove comment tags or comments.

    Additional Context (Optional)

    No response

    Dependency Updates

    • Yes, I've updated all my dependencies.

    Evaluation contract

    Marks are clearable by default. A mark configured with clearable: false must survive unsetAllMarks(), while unsetAllMarks({ignoreClearable: true}) removes it. Calling can().unsetAllMarks() on a selection containing only non-clearable marks is a successful no-op and must return true; explicitly calling unsetMark may still remove a non-clearable mark.

    Interface

    Type: Mark configuration option Name: MarkConfig.clearable Path: packages/core/src/Mark.ts Type: boolean | (() => boolean) Default: true Description: Controls whether unsetAllMarks removes this mark. Set false for semantic marks such as comments that must survive clear-formatting operations.

    Type: Command Name: unsetAllMarks Path: packages/core/src/commands/unsetAllMarks.ts Input: options?: { ignoreClearable?: boolean } Output: ReturnType Description: Removes clearable marks from the current selection. Marks configured with clearable: false are preserved unless ignoreClearable is true. can().unsetAllMarks() returns true when the selection contains only non-clearable marks; this case is a successful no-op.

  2. Assistant

    I’ll trace the core command and mark configuration patterns, read the repository’s code/testing/versioning guidance, then implement the smallest tested change and add the required changeset.

  3. Assistant

    The current command removes every ProseMirror mark indiscriminately. I’m checking how extension fields are resolved (including function-valued config) and the existing command-test conventions so clearable behaves consistently with other mark options.

  4. Assistant

    I’ll implement this as a core mark policy: all marks remain clearable by default, semantic extensions can opt out with clearable: false, and the command’s override restores the legacy “remove everything” behavior. Tests will cover defaults, preservation, function-valued config, the override, can() no-op semantics, and direct unsetMark.

  5. Assistant

    The first test run exposed a fixture issue, not command behavior: custom marks need a DOM renderer because Editor constructs a live view. I’m correcting the test mark definitions and the expected JSON shape, then rerunning.

  6. Assistant

    The targeted runtime tests pass. The core declaration build caught one strict generic-storage indexing error in the new extension context; I’m applying the same typed-key pattern already used by ExtensionManager, then I’ll rerun build and checks.

  7. Assistant

    Core’s full unit suite now passes (382 tests), and there is no public extension-comments package in this checkout, so the reusable core opt-out is the applicable change here. I’m moving through the repository-wide validation checklist now; any unrelated environment failure will be called out distinctly.

  8. Assistant

    Repository-wide lint, build, and all 1,069 unit tests pass. The unit runner emitted existing happy-dom iframe/network teardown warnings, but exited successfully with no failed tests. I’m running the final Chromium e2e check and then doing a clean diff review.

  9. Assistant

    The e2e suite is blocked before execution because the required Playwright Chromium binary is not installed; all 608 cases report the same missing executable. Installing it would require an external download, which is outside this task’s no-internet constraint. I’m finishing with a source/diff sanity check and rerunning the focused tests after the last formatting pass.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.