Skip to content

feat(ios): Settings UI for main app — diacritics + default language#2

Merged
kunichik merged 12 commits into
masterfrom
claude/test-mobile-devices-oEDyE
Apr 10, 2026
Merged

feat(ios): Settings UI for main app — diacritics + default language#2
kunichik merged 12 commits into
masterfrom
claude/test-mobile-devices-oEDyE

Conversation

@kunichik

Copy link
Copy Markdown
Owner

No description provided.

claude added 12 commits April 7, 2026 16:54
Kotlin-based Android Input Method with:
- Ukrainian ЙЦУКЕН + English QWERTY keyboard layouts
- Translit mode (KMU 2010): type Latin → get Ukrainian Cyrillic
- Language switch button (UK ↔ EN)
- Symbols/numbers layout
- Custom Canvas-drawn keyboard with haptic feedback
- Settings activity with IME enable/switch guidance
- Dark theme matching desktop Clavi aesthetics

https://claude.ai/code/session_013HBuRCzHgBxWzX1S2hLw8W
…p (v0.2)

Clipboard history strip (v0.2):
- ClipboardHistory.kt: listens to ClipboardManager, stores up to 20 entries
  newest-first, deduplicates, seeds from current clipboard on start
- ClaviKeyboardView: renders scrollable chip strip above keyboard rows;
  handles tap (insert), long-press (remove), clear (✕) button
- ClaviIME: wires clipboard listener, OnStripListener callbacks,
  refreshes strip on onStartInputView

CLAUDE.md:
- Full project spec (from original) + new Mobile section:
  Android/iOS roadmap, smart diacritics spec, local market packs plan,
  clipboard history UX rationale, "speed over features" principle,
  "fix don't rewrite" text improvement guideline

https://claude.ai/code/session_013HBuRCzHgBxWzX1S2hLw8W
- ClaviKeyboardView: long press chip (500ms) fires onClipLongPress
  to remove entry from history
- Handler/Runnable pattern; cancelled on ACTION_UP/CANCEL
- colors.xml: add strip_bg, strip_chip_bg, strip_chip_text

https://claude.ai/code/session_013HBuRCzHgBxWzX1S2hLw8W
iOS (Swift, UIKit):
- Custom Keyboard Extension scaffold
- UK ЙЦУКЕН + EN QWERTY layouts
- Translit mode (KMU 2010) — same engine as Android
- Language switch UK ↔ EN
- Clipboard history strip
- Info.plist with RequestsOpenAccess=true for clipboard

Android CI (GitHub Actions):
- android.yml: builds debug + release APK on every push
- Uploads APK as artifact (downloadable from Actions tab)
- Caches Gradle for fast builds

https://claude.ai/code/session_013HBuRCzHgBxWzX1S2hLw8W
Android:
- DiacriticsEngine: frequency-ordered variants for PT, DE, NO, FR, ES, SV, FI, PL
- ClaviKeyboardView: diacritics strip (teal bg) overrides clipboard strip when active
- Tapping variant: deletes base letter, inserts diacritic (e.g. 'a' → 'ã')
- ClaviIME.setDiacriticsLocale(): enable per-language diacritics
- Diacritics clear on backspace, space, translit input

iOS (Swift):
- DiacriticsEngine.swift: mirrors Android logic exactly, same language tables

UX: most-common variant highlighted in teal (leftmost = tap once),
base letter shown last in grey as fallback without diacritic.

https://claude.ai/code/session_013HBuRCzHgBxWzX1S2hLw8W
Add TextFixEngine with local spell-check: double space, space before
punctuation, missing space after sentence, Ukrainian/English typos,
repeated characters. Analysis triggers after space key, result shown
as green fix strip above keyboard. Tap to apply, tap ✕ to dismiss.

Fix settings.gradle.kts dependencyResolutionManagement (Gradle Kotlin DSL).

https://claude.ai/code/session_013HBuRCzHgBxWzX1S2hLw8W
Use explicit this.textSize inside apply{} blocks to disambiguate from
outer-scope val textSize variables in drawStrip and drawDiacriticsStrip.

https://claude.ai/code/session_013HBuRCzHgBxWzX1S2hLw8W
Add language dropdown (off / pt / de / no / fr / es / sv / fi / pl)
saved to SharedPreferences. ClaviIME reads the preference on keyboard
open and activates the smart diacritics strip accordingly.

https://claude.ai/code/session_013HBuRCzHgBxWzX1S2hLw8W
Add contributor instructions for all major AI coding tools:
- AGENTS.md (OpenAI Codex / general)
- .cursor/rules/project.mdc + android.mdc (Cursor)
- .windsurfrules (Windsurf)
- .github/copilot-instructions.md (GitHub Copilot)
- .clinerules (Cline / OpenClaw)

All cover: project architecture, hard rules (no Russian, no cloud),
Android strip system, translit engine, TextFixEngine contract,
build commands, and known gotchas.

Also add default language preference (UK/EN toggle) to SettingsActivity,
read in ClaviIME.onCreateInputView via SharedPreferences.

https://claude.ai/code/session_013HBuRCzHgBxWzX1S2hLw8W
- TextFixEngine.swift: mirror of Kotlin version — double space,
  space-before-punct, missing-space-after-sent, UK/EN typo dicts,
  repeated chars. analyze() returns Fix(original, fixed, description).
- ClaviKeyboardView: add fix strip (green) + diacritics strip (teal)
  with same priority as Android: fix > diacritics > clipboard.
- KeyboardViewController: wire TextFix (triggers on space),
  diacritics (triggers on base letter), loadPreferences() reads
  diacritics_locale + default_language from shared UserDefaults.

https://claude.ai/code/session_013HBuRCzHgBxWzX1S2hLw8W
K'iche' (QUC) keyboard — ALMG standard orthography:
- Row 1: QWERTY, row 2: with apostrophe key for glottalization
- Row 3: ch/tz/xh as single keys + z x b n m
- Language cycle: UK → EN → Q' → UK (no translit in QUC mode)
- Settings: default language now includes K'iche' option

Haptic feedback toggle in Settings → stored in SharedPreferences,
read by ClaviKeyboardView.hapticEnabled on keyboard open.

TextFixEngine: expanded from 20 to 70+ typos:
- Ukrainian: missing apostrophe (пам'ять, комп'ютер, etc.), translit artifacts
- English: contractions (don't, can't, I'm...), i-before-e, double-letter
  confusion, 30+ classic misspellings, mixed Cyrillic/Latin key typos

https://claude.ai/code/session_013HBuRCzHgBxWzX1S2hLw8W
SettingsViewController with dark theme (#263238) matching Android:
- Section Setup: instructions + button to open iOS Settings
- Section Diacritics Language: picker (off/pt/de/no/fr/es/sv/fi/pl)
  saved to shared UserDefaults (group.com.clavi.keyboard)
- Section Default Language: Ukrainian / English toggle

https://claude.ai/code/session_013HBuRCzHgBxWzX1S2hLw8W
@kunichik
kunichik merged commit 2928bd0 into master Apr 10, 2026
1 check passed
kunichik pushed a commit that referenced this pull request Apr 10, 2026
…ps fix

- TranslationEngine (Android/iOS): 2-tier translation — ML Kit/Apple
  Translation (sentence-level, ~30MB on-demand) with bundled TSV
  word-dictionary fallback (~500 EN↔UK word pairs, zero download)
- ClaviKeyboardView: blue translation strip (fix > translation >
  diacritics > clipboard priority); tap to replace typed text
- ClaviIME/KeyboardViewController: trigger translation after space/
  enter; password field detection (hides clipboard + disables translit)
- SettingsActivity/SettingsViewController: source + target language
  pickers for translation; saves to shared prefs
- TextFixEngine: fixAccidentalCaps() — detects "ПРивіт" → "Привіт"
  pattern (2 leading caps + lowercase body)
- CLAUDE.md: update Hard Rule #2 to allow optional E2E-encrypted sync
  account (zero-knowledge, local-only by default, no keystrokes)

https://claude.ai/code/session_013HBuRCzHgBxWzX1S2hLw8W
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants