Skip to content

Fix LT-22630: Custom first vernacular fields defaulting to analysis#1015

Open
jasonleenaylor wants to merge 2 commits into
mainfrom
bugfix/LT-22630
Open

Fix LT-22630: Custom first vernacular fields defaulting to analysis#1015
jasonleenaylor wants to merge 2 commits into
mainfrom
bugfix/LT-22630

Conversation

@jasonleenaylor

@jasonleenaylor jasonleenaylor commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Quick Summary

Fixes LT-22630: since FW 9.3.7, typing in a custom single-string field configured for First Vernacular came out in the first analysis writing system.

The LT-22145 fix overrode StringSliceView.WsPending to always return DefaultAnalWs and swallow writes, turning the one-shot pending-ws mechanism into a permanent forced writing system for every keystroke in these slices. This PR scopes the override to the case LT-22145 was actually about — an empty field, where there is no adjacent text to inherit a ws from — and picks the ws the slice was configured with: the constructor-specified ws (custom fields), else the wsempty config default, else DefaultAnalWs. When the field has content, the getter returns -1 so typing inherits the surrounding text's writing system.

  • StringSlice.cs: empty-field-scoped WsPending getter; DefaultWs (the wsempty attribute) now stored on the view; empty-check handles String and MultiString/MultiUnicode props.
  • StringSliceUtils.cs: the ws fallback chain as a pure GetWsForEmptyField function.
  • StringSliceUtilsTests.cs: unit tests for the chain, including that negative magic-ws constants are never treated as real handles.

CI-ready checklist

  • Commit messages follow .github/commit-guidelines.md (subject ≤ 72 chars, no trailing punctuation; if body present, blank line then ≤ 80-char lines).
  • No whitespace warnings locally:
    git fetch origin
    git log --check --pretty=format:"---% h% s" origin/<base>..
    git diff --check --cached
  • Builds/tests pass locally (or I've run the CI-style build via Bash script or MSBuild).
  • If this is core-developer AI-assisted work, I followed Docs/workflows/ai-pr-workflow.md and ran pr-preflight or the equivalent branch-readiness review before requesting review.
  • For any Src/** folders touched, corresponding AGENTS.md files are updated or explicitly confirmed still accurate.

Notes for reviewers (optional)

  • Behavior for LT-22145's fields (Source on Sense, Reference on Example) is unchanged when empty: they still default to first analysis. The change additionally un-breaks typing inside existing non-analysis text in plain string fields, which the old override forced to analysis per keystroke.
  • The only shipped wsempty user (Data Notebook Title, wsempty="analysis") resolves to DefaultAnalWs, identical to the last-resort fallback, so honoring it changes nothing for existing configurations.
  • DetailControlsTests pass locally (67 passed, 1 skipped, including 4 new tests). Manual acceptance tests for both tickets in live FLEx are still pending; this is a draft until that verification is done.

🤖 Generated with Claude Code


This change is Reviewable

@jasonleenaylor
jasonleenaylor marked this pull request as ready for review July 16, 2026 23:26
jasonleenaylor and others added 2 commits July 16, 2026 16:29
The LT-22145 fix made StringSliceView.WsPending force DefaultAnalWs on
every keystroke, so typing in custom fields configured for another
writing system came out as analysis. WsPending now supplies a writing
system only when the field is empty, using the ws configured for the
slice and falling back to DefaultAnalWs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The chooser reads the selection's props, which fall back to the UI ws
in an empty field even though typing uses the slice's configured ws.
Set typing props on an insertion point in an empty field so the
chooser and keyboard agree with what typing will produce.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

NUnit Tests

    1 files  ±0      1 suites  ±0   9m 47s ⏱️ - 1m 2s
4 306 tests +4  4 233 ✅ +5  73 💤 ±0  0 ❌  - 1 
4 315 runs  +4  4 242 ✅ +5  73 💤 ±0  0 ❌  - 1 

Results for commit d6a977f. ± Comparison against base commit b30d631.

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.

1 participant