uttrflow / uttrflow/uttrflow-swift

Test note checkboxes written with single-quoted or unquoted type, and NotePromotion escaping quotes

Open Beginner friendly
#740 0 comments 0 reactions 0 assignees View on GitHub
area:clipboard enhancement good first issue P2
Dominant language
Swift
Stars
4
Forks
17
Avg merge
4h 27m
Merged PRs (30d)
286

Description

## What happens

`Sources/UttrflowClipboard/NoteChecklist.swift`:

- lines 68-70: `inputBox` accepts `type='checkbox'` and `type=checkbox`, but tests only use `type="checkbox"`. The `else { return nil }` for an `` that isn't a checkbox has never run either;
- lines 88-89: `hasAttribute` finding `checked` followed by `/`, whitespace, or the end of the tag;
- line 123: `tokens(of:in:)` with a `class="` that never closes;
- lines 137-139 and 149: `replacingToken` and `withoutCheckedAttribute` finding no spelling to change;
- lines 172-173: `NotePromotion.escaped` turning `"` into `"` and `'` into `'`.

Measured on origin/main `26d7bc1` with `swift test --enable-code-coverage` (5,384 tests, all passing) and `xcrun llvm-cov export` over the test binary. The regions named below have an execution count of 0: no test runs them, so a change that breaks them passes `make verify`.

## Why it matters

Ticking a box in a note rewrites HTML that other apps and websites wrote, and different editors write checkboxes differently. If single quotes stop matching, a box can't be ticked. If escaping `'` or `"` breaks, promoting a plain clip such as `it's "done"` to a note garbles the text when it is read back.

## How to reproduce

Run `swift test --enable-code-coverage`, then `xcrun llvm-cov show -instr-profile .build/debug/codecov/default.profdata .build/debug/UttrflowPackageTests.xctest/Contents/MacOS/UttrflowPackageTests Sources/UttrflowClipboard/NoteChecklist.swift` and look for the `0` counts on the lines named above.

## Acceptance criteria

- Table cases: ``, ``, and `` (not a box).
- `NotePromotion.note(from: "it's \"done\"")` contains `'` and `"`, and reads back through `RichTextPlainForm.plainText(fromHTML:)` as the original.
- An `

  • `, then run `make verify` before pushing. Only tests change; no product code needs to.

    **Size:** S, under an hour.

  • Contributor guide

    Open the contributing guide

    Research direction

    Read CONTRIBUTING.md, then open Tests/UttrflowClipboardTests/NoteChecklistTests.swift and the “E5 · ticking a box in a note” suite. Add the specified table and escaping cases, run the suite with swift test --filter, verify each test fails when its covered branch is temporarily broken, and finish with make verify.

    Written by the indexing model from the issue text.

    Assessment

    Tech stack
    swift
    Domain
    testing
    Issue type
    Refactor
    Difficulty
    2/5
    Estimated time
    Under an hour
    Activity status
    Active
    Clarity
    Clearly specified
    Newbie friendliness
    92/100

    Get new issues in your inbox

    A short digest of beginner-friendly GitHub issues.