Skip to content

Keep the word gloss on one line across tokens - #300

Merged
alex-rawlings-yyc merged 2 commits into
mainfrom
enhancement/align-token-gloss-line
Sep 3, 2026
Merged

Keep the word gloss on one line across tokens#300
alex-rawlings-yyc merged 2 commits into
mainfrom
enhancement/align-token-gloss-line

Conversation

@alex-rawlings-yyc

@alex-rawlings-yyc alex-rawlings-yyc commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

This change is Reviewable

Summary by CodeRabbit

  • New Features

    • Improved morphology slot alignment across analyzed and unanalyzed tokens.
    • Read-only unanalyzed tokens now preserve gloss alignment with an inert visual placeholder.
    • Updated morphology slot styling for consistent sizing and spacing.
  • Tests

    • Added coverage for morphology slot classes, placeholders, accessibility attributes, and conditional rendering.

@alex-rawlings-yyc alex-rawlings-yyc self-assigned this Sep 2, 2026
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: ddf0cc10-b69d-44e3-9141-1bb1a65e062a

📥 Commits

Reviewing files that changed from the base of the PR and between 4798734 and a813592.

📒 Files selected for processing (5)
  • src/__tests__/components/MorphemeBox.test.tsx
  • src/__tests__/components/TokenChip.test.tsx
  • src/components/MorphemeBox.tsx
  • src/components/TokenChip.tsx
  • src/tailwind.css

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The PR adds a shared morphology-slot utility and updates editable and read-only token rendering to use hidden spacers for consistent morphology alignment. Tests cover slot classes, accessibility attributes, and conditional rendering.

Changes

Morphology alignment

Layer / File(s) Summary
Shared slot metrics
src/tailwind.css, src/components/MorphemeBox.tsx, src/__tests__/components/MorphemeBox.test.tsx
Adds the morphology-slot utility and uses it for MorphemeBox metrics. Tests verify the class on the grid container.
Editable slot rendering
src/components/TokenChip.tsx, src/__tests__/components/TokenChip.test.tsx
Adds hidden morphology spacers to editable unanalyzed tokens and the define-breakdown label. Tests verify slot classes and aria-hidden.
Read-only slot rendering
src/components/TokenChip.tsx, src/__tests__/components/TokenChip.test.tsx
Renders an inert slot for read-only unanalyzed tokens. Tests verify spacer omission when morphology is hidden or morphemes exist.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to a8135

This change standardizes morphology-slot sizing and adds hidden alignment spacers for editable and read-only unanalyzed tokens, with no identified merge-blocking impact.

Suggested reviewers: jasonleenaylor, imnasnainaec

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: keeping word glosses on one line across tokens.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. (1 skipped: 1 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch enhancement/align-token-gloss-line

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/__tests__/components/MorphemeBox.test.tsx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

src/__tests__/components/TokenChip.test.tsx

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

src/components/MorphemeBox.tsx

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

  • 2 others

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@alex-rawlings-yyc alex-rawlings-yyc linked an issue Sep 2, 2026 that may be closed by this pull request
@alex-rawlings-yyc
alex-rawlings-yyc marked this pull request as ready for review September 2, 2026 23:00
@alex-rawlings-yyc
alex-rawlings-yyc force-pushed the enhancement/align-token-gloss-line branch from 86b0142 to a813592 Compare September 3, 2026 17:36

@imnasnainaec imnasnainaec 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.

@imnasnainaec reviewed 5 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on alex-rawlings-yyc).

@imnasnainaec

Copy link
Copy Markdown
Contributor

(PR probably would have benefitted from screenshot.)

@alex-rawlings-yyc
alex-rawlings-yyc merged commit d91d78c into main Sep 3, 2026
8 of 10 checks passed
@alex-rawlings-yyc
alex-rawlings-yyc deleted the enhancement/align-token-gloss-line branch September 3, 2026 18:41
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.

Keep the word gloss on a consistent bottom line across tokens

2 participants