Skip to content

Sort entry list by vernacular writing systems - #2618

Closed
hahn-kev-bot wants to merge 4 commits into
developfrom
claude/sort-vernacular-writing-systems-30dfa0
Closed

Sort entry list by vernacular writing systems#2618
hahn-kev-bot wants to merge 4 commits into
developfrom
claude/sort-vernacular-writing-systems-30dfa0

Conversation

@hahn-kev-bot

@hahn-kev-bot hahn-kev-bot commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

We've had backend support for a long time, we just never brought it to the frontend.

Per our team meeting we decided that WS should be a separate selection since it's also can effect the best match sort order. It still effects how rows are displayed.

WS Select (vernacular only):
image

The selected value shows the abbreviation, falling back to the name. In the dropdown it just shows the full name, with the abbreviation as the muted text (falling back to the wsId)

image image

Fallback when the selected WS has no value:
image


🤖 AI summary

Brings the backend's existing per-writing-system sort to the FwLite viewer's entry list. Sorting/displaying by a writing system was always supported server-side (ISortOptions.writingSystementry.Headword(order.WritingSystem)); the viewer hardcoded 'default'. Frontend-only change.

Per team feedback, writing-system selection lives in its own pill, separate from the sort field/direction:

  • SortMenu is unchanged from before this PR — Auto / Best match / Headword ↑ / Headword ↓.
  • SortWritingSystemMenu (new) is a badge/pill dropdown listing the vernacular writing systems (excluding audio), defaulting to the first (the default vernacular) — i.e. today's behavior. It's hidden when a project has only one such writing system.
  • BrowseView merges the pill's writing system into the SortConfig it passes to the list, so both the query order and the displayed headword follow it.
  • EntryRow shows the headword for the selected writing system via WritingSystemService.sortedHeadword(entry, ws), which prefers that writing system but falls back to another vernacular value so rows aren't left blank. The strict headword(entry, ws) (search filtering, duplicate detection) is unchanged.
  • entry-loader-service passes the selected writing system to the query order instead of always 'default'.

Considered and rejected

  • Listing writing systems inside the sort dropdown (the first iteration of this PR) — replaced with the dedicated pill per team feedback.
  • Strict (blank when empty) headword display — kept the fallback so the list doesn't fill with "Untitled".

Test plan

  • frontend/viewer UI tests (tests/ui/sort.test.ts): the sort menu no longer lists writing systems; the pill lists the vernacular writing systems and excludes audio; selecting one switches the displayed headword to that writing system's form. Full viewer UI suite green (62 passed).
  • pnpm run check (svelte-check) — 0 errors.
  • pnpm run i18n:extract — new "Sort writing system" string extracted across locales.

Add sort options for each vernacular writing system (excluding audio) to
the FwLite viewer's entry list, alongside the existing default-headword
sort. The chosen writing system now flows through to the query order (the
backend already supported it) instead of always sorting by 'default'.

When sorting by a specific writing system, the headword shown in the
entry list (simple mode) switches to that writing system, preferring it
but falling back to another vernacular value so rows aren't left blank.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: dc1f9753-9767-4b6e-96a9-7c0d7a377496

📥 Commits

Reviewing files that changed from the base of the PR and between 373f542 and fb8c776.

📒 Files selected for processing (18)
  • frontend/viewer/src/lib/services/entry-loader-service.svelte.ts
  • frontend/viewer/src/locales/en.po
  • frontend/viewer/src/locales/es.po
  • frontend/viewer/src/locales/fr.po
  • frontend/viewer/src/locales/id.po
  • frontend/viewer/src/locales/ko.po
  • frontend/viewer/src/locales/ms.po
  • frontend/viewer/src/locales/sw.po
  • frontend/viewer/src/locales/vi.po
  • frontend/viewer/src/project/browse/BrowseView.svelte
  • frontend/viewer/src/project/browse/EntriesList.svelte
  • frontend/viewer/src/project/browse/EntryRow.svelte
  • frontend/viewer/src/project/browse/sort/SortMenu.svelte
  • frontend/viewer/src/project/browse/sort/SortWritingSystemMenu.svelte
  • frontend/viewer/src/project/browse/sort/options.ts
  • frontend/viewer/src/project/data/writing-system-service.svelte.ts
  • frontend/viewer/tests/ui/entry-api-helper.ts
  • frontend/viewer/tests/ui/sort.test.ts

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.

@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Sep 2, 2026
@argos-ci

argos-ci Bot commented Sep 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ⚠️ Changes detected (Review) 6 changed Sep 3, 2026, 3:26 AM
e2e (Inspect) ⚠️ Changes detected (Review) 6 changed Sep 3, 2026, 3:35 AM

Revert the sort dropdown to its original headword/relevance options, and
add a separate badge/pill dropdown for choosing the writing system to
sort and display by. It lists the vernacular writing systems (excluding
audio) and defaults to the first (the default vernacular) — matching
today's behavior. The pill is hidden when a project has only one such
writing system, so nothing to choose means no extra control.

The chosen writing system is merged into the sort passed to the entry
list, so both the query order and the displayed headword follow it, as
before.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@hahn-kev

hahn-kev commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

@myieye It looks like FLEx sometimes shows the region in a dropdown for picking a writing system as it helps disambiguate. Originally in the dropdown I just showed the name, with wsId muted. However this meant that we never displayed the abbreviation, which is what people are used to seeing, so I changed around how it works. I could even see making the abbreviation the primary and the full name the muted value.

hahn-kev and others added 2 commits September 3, 2026 10:00
Show the abbreviation (falling back to the wsId) as the muted text in the
sort writing-system dropdown instead of the wsId.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Drop the now-unnecessary SortConfig cast (the interface accepts the
object literal directly) and use function declarations for the test
locator helpers to satisfy func-style.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@myieye

myieye commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

@myieye It looks like FLEx sometimes shows the region in a dropdown for picking a writing system as it helps disambiguate. Originally in the dropdown I just showed the name, with wsId muted. However this meant that we never displayed the abbreviation, which is what people are used to seeing, so I changed around how it works. I could even see making the abbreviation the primary and the full name the muted value.

I think it looks good. 👍🏻
Did you try/consider making it look like a group i.e. a single split badge

I'm wondering: should we filter the writing systems in the list based on the current view?

I thought of it, because a team recently asked (via Sara) why the dictionary preview shows WS's that are excluded from the editor (via a custom view). It seems reasonable to me that everything should be aligned based on the view.

@hahn-kev

hahn-kev commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Yeah that's probably a good idea. Should we apply that here you think? or just do it all at once in another PR?

@myieye

myieye commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

@hahn-kev Yeah, another PR is fine. I'm still curious about potentially using a single split badge. Up to you

@myieye

myieye commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator
Multi-language project, desktop Mobile

One vernacular + one analysis (the common project) — no headings at all:

@myieye myieye closed this Sep 4, 2026
@hahn-kev

hahn-kev commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

@myieye what's up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants