uttrflow / uttrflow/uttrflow-swift

Dictionary words can't be edited: adding a pronunciation means deleting the word and losing its counts

Open
#688 0 comments 0 reactions 0 assignees View on GitHub
area:dictation enhancement needs-info P2
Dominant language
Swift
Stars
4
Forks
17
Avg merge
3h 32m
Merged PRs (30d)
277

Description

## What happens

A dictionary word cannot be edited. `DictionaryDraft` has "two fields and no identifier, since a row is never edited, only re-added" (`Sources/UttrflowUX/DictionaryPresentation.swift:58`), and a row's actions are Restore (retired words) and Delete (`:259-260`). Snippets, by contrast, have Edit (`Sources/UttrflowUX/SnippetsPresentation.swift:247-249`).

Re-adding does not work as a substitute while the word is there: the editor refuses a spelling that matches an existing entry, "“X” is already in your dictionary." (`DictionaryPresentation.swift:312-324`, case-insensitive), because "re-adding resets its counters".

So to add or fix a pronunciation ("Say it like"), or to correct a spelling's capitalisation, the user must:

1. delete the word, losing its "Used" and "Undone" counts and its origin (a Learned or Seen-on-screen word becomes "Added by you"), then
2. add it again.

The pronunciation hint itself says the field is often needed after the fact: it is the only way a spelling with no English letters is matched by sound (`pronunciationHint`, `:294-309`), which a user typically discovers only once the word keeps failing.

## Why it matters

The most common dictionary chore is "it keeps getting this name wrong, let me tell it how it sounds". Doing that for a word Uttrflow learned throws away the evidence that retires or keeps the word, and a learned or shipped word is the one most likely to need a pronunciation added later. Non-English names are where this matters most.

## How to reproduce

Open Dictionary, point at any row: there is no Edit. Press Add Word and type an existing spelling with a pronunciation: Save is refused.

## Acceptance criteria

Product call (hence `needs-info`): may a word's spelling change, or only its pronunciation?

Then:

- A row offers Edit, opening the inline editor on that entry with its current values.
- Saving an edit keeps the entry's identity, origin (unless the product call says otherwise) and counters.
- The duplicate check ignores the entry being edited, as `SnippetsPresenter.problem` does with `draft.editing`.
- `PersonalDictionaryStore` gains an update that keeps identity and counters, with tests in `Tests/UttrflowDictionaryTests`; `Tests/UttrflowUXTests/DictionaryPresentationTests.swift` covers the editor in edit mode.

Contributor guide

Open the contributing guide

Research direction

First resolve the product call about whether spelling may change or only pronunciation. Read Sources/UttrflowUX/DictionaryPresentation.swift and compare its editor and duplicate-check behavior with Sources/UttrflowUX/SnippetsPresentation.swift; then inspect PersonalDictionaryStore. Add coverage in Tests/UttrflowDictionaryTests and Tests/UttrflowUXTests/DictionaryPresentationTests.swift, with editing preserving identity, origin, and counters.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, swift
Domain
desktop, testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.