Repository navigation
Conversation
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
c0483ba to
7d7a4c0
Compare
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
7d7a4c0 to
7433283
Compare
Several user-visible counts were written with a plural noun: the panel's
whitespace row ("1 characters"), a formatted-text row, the Insights range label
("1 words") and its coverage line ("1 of 1 days shown"), three Diagnostics
counters, and the typing-stopped error ("0 of 1 characters").
Add CountedNoun to UttrflowCore — the modules that need it cannot import
UttrflowUX — and route each site through it. MainFormatting.count now delegates
to the same helper so every surface writes the same words.
- Sources/UttrflowCore/Support/CountedNoun.swift: the noun, and the count with it
- Sources/UttrflowCore/Errors/TextInsertionError.swift, Sources/UttrflowClipboard/Clip.swift:
the two sites outside UttrflowUX
- Sources/UttrflowUX/{MainPresentation,PanelPresenter+RowProjection,InsightsPresentation,
DiagnosticsPresentation}.swift: the five sites inside it
- Tests: CountedNounTests, a clip case, and the Insights/Diagnostics cases at a count of one
Refs uttrflow#7913
The new public helper adds a type and two functions to UttrflowCore, so the baseline rises by one each and the audit can review the delta instead of failing on it. Refs uttrflow#7913
7433283 to
453501d
Compare
|
Rebased onto The formatted-text row is gone. The baseline was re-recorded by the repo's own tool. Local evidence on this Mac:
So the Insights and Diagnostics unit cases are unverified locally; CI is the gate for those. |
What this changes, and why
Six user-visible counts were written with a plural noun. Each now reads the singular at exactly one:
Whitespace only · 1 character(Clip.swift)1 word · 16 October, and the coverage line:Dictated on 1 of 1 day shown.(InsightsPresentation.swift)0 of 1 piece,0 of 1 segment,0 of 1 dictation(DiagnosticsPresentation.swift)Typing stopped after 0 of 1 character.(TextInsertionError.swift)The obvious inline fix (
count == 1 ? "character" : "characters"at each site) would have repeated the same ternary in six files across three modules, andUttrflowClipboardandUttrflowCorecannot importUttrflowUXwhere the existingMainFormatting.countlives. SoCountedNoungoes intoUttrflowCore—of(_:singular:plural:)for the noun alone andcount(_:singular:plural:)for the number with it — andMainFormatting.countnow delegates to it, so the surfaces cannot drift apart again.The noun follows the number the sentence actually prints: the Insights coverage line counts reachable days, so
1 of 2 days shownstays plural, and1 of 1 day showndoes not.How you know it works
Unit cases added, one per surface:
CountedNounTests(new file), aClipTestscase at one and two spaces,InsightsPresenter.captionand.coverageat a count of one and of two, andDiagnosticsPresenter.decodingRows/.segmentRowsat a single piece and a single segment (both also at the plural stay unchanged).The test suite did not run on my machine, and I have not ticked
make verifybelow.swift testcannot build the test bundle here, on two failures that are present on a clean checkout ofmainand in files this change does not touch:Tests/UttrflowClipboardTests/SecretShapesMutationTests.swiftandSecretShapesOracleTests.swift:the compiler is unable to type-check this expression in reasonable timeTests/UttrflowInputTests/SuggestionAcceptorTests.swift: the compiler crashes while emitting SIL forinsertRefusesWhenCancelledBoth are Swift 6.4 / macOS 27 toolchain behaviour; CI runs
macos-26. Moving those files aside does not help, because other tests in the same target use helpers they define.What did run locally:
So the new test files compile, but they have not executed anywhere yet: in
.github/workflows/ci.ymla pull request runs the static job only (make verify=verify-static), and the full gate (make verify (full): build, unit tests, coverage, offline audit) runs onworkflow_dispatch. A maintainer running it will be the first execution; if it fails there, it is mine to fix.The change adds one public type and two public functions to
UttrflowCore, soScripts/public_api_baseline.jsonrecords them (enum CountedNoun: 1,func count: 2,func of: 7) — the second commit is that line, so the audit reviews the delta instead of failing on it.make verifypasses locally — the static half does (make verify-staticis green here, and themake verifyjob is green on this head); the build the other half needs cannot complete on this machine (lint, PII audit, build, tests, coverage floor, offline audit) — see above: build and tests cannot run on this machine, lint and the comment audit do passDrafted with an AI coding assistant (OpenCode Go,
deepseek-v4.1-flash) and reviewed against the issue's expected strings; the runs quoted above are from this branch.Fixes #7913