Skip to content

LT-22725: Show abbreviation for user-defined natural classes - #1158

Merged
aror92 merged 2 commits into
mainfrom
LT-22725-NC_abbr
Sep 29, 2026
Merged

aror92 merged 2 commits into
mainfrom
LT-22725-NC_abbr

Conversation

@aror92

@aror92 aror92 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

In the phonological rule formula, a feature-based natural class was always drawn as its list of features, even when the user had built and named the class. Only classes abbreviated "C" or "V" showed their abbreviation, and only when they had a single feature.

The rule view now draws a user-defined feature-based natural class as its abbreviation in brackets, whatever its number of features. An empty abbreviation displays as "***". Classes created automatically when features are inserted directly into a rule still display their features.

A class counts as user-defined when it has a name that is not auto-generated. That check now takes the natural class as an argument, so the view can apply it to each class it draws rather than to the current selection. Line count and width use the same check, so the cell is sized to the abbreviation.


This change is Reviewable

In the phonological rule formula, a feature-based natural class was
always drawn as its list of features, even when the user had built
and named the class. Only classes abbreviated "C" or "V" showed
their abbreviation, and only when they had a single feature.

The rule view now draws a user-defined feature-based natural class
as its abbreviation in brackets, whatever its number of features.
An empty abbreviation displays as "***". Classes created
automatically when features are inserted directly into a rule
still display their features.

A class counts as user-defined when it has a name that is not
auto-generated. That check now takes the natural class as an
argument, so the view can apply it to each class it draws rather
than to the current selection. Line count and width use the same
check, so the cell is sized to the abbreviation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: Iebd499482136c21f722e1ed102920caa69a71e9f
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Comment hygiene (advisory)

No comment-style violations in the lines this branch adds since origin/main.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

NUnit Tests

    1 files  ±0      1 suites  ±0   10m 0s ⏱️ - 2m 36s
6 232 tests ±0  6 147 ✅ ±0  85 💤 ±0  0 ❌ ±0 
6 241 runs  ±0  6 156 ✅ ±0  85 💤 ±0  0 ❌ ±0 

Results for commit 1caadd9. ± Comparison against base commit a1d73aa.

♻️ This comment has been updated with latest results.

@codecov-commenter

codecov-commenter commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 105 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.94%. Comparing base (a1d73aa) to head (1caadd9).

Files with missing lines Patch % Lines
Src/LexText/Morphology/RuleFormulaVcBase.cs 0.00% 76 Missing and 20 partials ⚠️
Src/LexText/Morphology/RuleFormulaControl.cs 0.00% 4 Missing and 1 partial ⚠️
Src/LexText/Morphology/RegRuleFormulaVc.cs 0.00% 2 Missing ⚠️
Src/LexText/Morphology/AffixRuleFormulaVc.cs 0.00% 1 Missing ⚠️
Src/LexText/Morphology/MetaRuleFormulaVc.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1158      +/-   ##
==========================================
- Coverage   38.95%   38.94%   -0.01%     
==========================================
  Files        1520     1520              
  Lines      352476   352528      +52     
  Branches    40636    40648      +12     
==========================================
- Hits       137296   137282      -14     
- Misses     185899   185952      +53     
- Partials    29281    29294      +13     
Files with missing lines Coverage Δ
Src/LexText/Morphology/AffixRuleFormulaVc.cs 0.00% <0.00%> (ø)
Src/LexText/Morphology/MetaRuleFormulaVc.cs 0.00% <0.00%> (ø)
Src/LexText/Morphology/RegRuleFormulaVc.cs 0.00% <0.00%> (ø)
Src/LexText/Morphology/RuleFormulaControl.cs 0.00% <0.00%> (ø)
Src/LexText/Morphology/RuleFormulaVcBase.cs 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Shorten comment lines to align with comment hygiene.

Register the display dependencies on NC's name and abbreviation
for displaying phonological & affix process rules. This ensures
if names or abbreviations are updated, the display widths are
recalculated so new names/abbreviations fit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: I97759674dbc305d54a0f75a8d21cbca321e1ed58
@aror92

aror92 commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

One ignored note from Devin's review:

Src/LexText/Morphology/RuleFormulaVcBase.cs:R642
Abbreviation measurement differs from displayed fallback
GetNCCtxtWidth measures BestAnalysisAlternative, but an empty abbreviation displays ***. Check whether affix-rule columns remain wide enough for the fallback.

BestAnalysisAlternative already uses *** as its fallback, so this is not an issue.

@aror92
aror92 marked this pull request as ready for review September 24, 2026 19:35

@thejambi thejambi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: - Jason plans to work on the tests for this.

@thejambi reviewed 5 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on aror92).

@aror92
aror92 merged commit b18c601 into main Sep 29, 2026
9 checks passed
@aror92
aror92 deleted the LT-22725-NC_abbr branch September 29, 2026 02:15
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.

3 participants