Skip to content

Sync dialog touch ups#2001

Merged
myieye merged 6 commits into
developfrom
sync-dialog-touch-ups
Sep 15, 2025
Merged

Sync dialog touch ups#2001
myieye merged 6 commits into
developfrom
sync-dialog-touch-ups

Conversation

@myieye

@myieye myieye commented Sep 11, 2025

Copy link
Copy Markdown
Collaborator

Made a few changes, because I was looking at it while writing to a user.

  • When not logged in, swapped the sync arrows and button in the Classic tab with a "Login" button
  • Now show the Classic tab when offline with an offline icon
  • Relabeled the "Last change" date in the FWLite tab to "Last sync"
    The date is a bit tricky.
    It actually means: this is the last time a change went across the wire.
    So, I think "Last sync" is a fair bit more accurate than "Last change".
image

@github-actions github-actions Bot added the 💻 FW Lite issues related to the fw lite application, not miniLcm or crdt related label Sep 11, 2025
@coderabbitai

coderabbitai Bot commented Sep 11, 2025

Copy link
Copy Markdown

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

Introduces sync-status-driven UI in FwLiteToFwMergeDetails.svelte with new props (syncStatus, server, onLoginStatusChange) and conditional rendering for offline/login states. SyncStatusPrimitive.svelte updates layout, moves “Last sync” display, adjusts remote gating, and passes new props downstream. Locale files replace “Last change: #” with “Last sync: #” and update message locations.

Changes

Cohort / File(s) Summary of changes
Sync UI components
frontend/viewer/src/project/sync/FwLiteToFwMergeDetails.svelte, frontend/viewer/src/project/sync/SyncStatusPrimitive.svelte
Adds props syncStatus, server, onLoginStatusChange to FwLiteToFwMergeDetails; implements conditional UI for Offline/NotLoggedIn; retains sync actions otherwise. In SyncStatusPrimitive: shows remote when server exists, moves “Last sync: …” to middle row, local label uses i18n, updates icon/layout, and passes new props to child.
Locales updates
frontend/viewer/src/locales/en.po, es.po, fr.po, id.po, ko.po, ms.po, sw.po
Replace msgid “Last change: #” with “Last sync: #”; add or update source locations (notably SyncStatusPrimitive.svelte). Expand locations for “Local” and adjust “Login” references (often to FwLiteToFwMergeDetails.svelte). Minor Swahili tweak for “loading...”. No substantive translation value changes except new/empty entries where noted.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • hahn-kev

Poem

I thump my paw: sync’s on track today,
Clouds drift offline, then hop back our way.
“Last sync:” whispers time in gentle rhyme,
Login buns queue, ears perked in line.
Local to remote, arrows boop-boop—ok!
Carrot commit pushed—hip hop, hooray! 🥕✨

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Title Check ✅ Passed The title "Use better label for lastLocalSyncDate" concisely identifies the main intent of the changeset — improving the label used for the lastLocalSyncDate field (changing "Last change" to "Last sync") and matches the localization and UI edits in the diff. It is specific and relevant to the PR's primary change.
Description Check ✅ Passed The description explains the rationale for the label change, notes that the displayed date represents the last transmitted change, and includes a screenshot; this directly relates to the changes in the diff and clarifies the author's intent. The content is on-topic and sufficiently tied to the changeset.

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 and usage tips.

@myieye myieye changed the title Use better label for lastLocalSyncDate Sync dialog touch ups Sep 11, 2025
@github-actions

github-actions Bot commented Sep 11, 2025

Copy link
Copy Markdown
Contributor

UI unit Tests

  1 files  ±0   45 suites  ±0   29s ⏱️ +2s
111 tests +1  111 ✅ +1  0 💤 ±0  0 ❌ ±0 
160 runs  +2  160 ✅ +2  0 💤 ±0  0 ❌ ±0 

Results for commit 047ab32. ± Comparison against base commit 3bf7e37.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Sep 11, 2025

Copy link
Copy Markdown
Contributor

C# Unit Tests

130 tests  ±0   130 ✅ ±0   19s ⏱️ ±0s
 20 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 047ab32. ± Comparison against base commit 3bf7e37.

♻️ This comment has been updated with latest results.

@argos-ci

argos-ci Bot commented Sep 11, 2025

Copy link
Copy Markdown

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

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Sep 15, 2025, 10:14 AM

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (9)
frontend/viewer/src/locales/es.po (1)

601-604: Provide Spanish translation for new key.

Suggested translation to avoid English fallback.

 #: src/project/sync/SyncStatusPrimitive.svelte
 msgid "Last sync: #"
-msgstr ""
+msgstr "Última sincronización: #"
frontend/viewer/src/locales/ms.po (1)

601-604: Add Malay translation for “Last sync: #”.

 #: src/project/sync/SyncStatusPrimitive.svelte
 msgid "Last sync: #"
-msgstr ""
+msgstr "Penyegerakan terakhir: #"
frontend/viewer/src/locales/id.po (1)

601-604: Add Indonesian translation for “Last sync: #”.

 #: src/project/sync/SyncStatusPrimitive.svelte
 msgid "Last sync: #"
-msgstr ""
+msgstr "Sinkronisasi terakhir: #"
frontend/viewer/src/locales/ko.po (1)

601-604: Add Korean translation for “Last sync: #”.

 #: src/project/sync/SyncStatusPrimitive.svelte
 msgid "Last sync: #"
-msgstr ""
+msgstr "마지막 동기화: #"
frontend/viewer/src/locales/sw.po (1)

601-604: Add Swahili translation for “Last sync: #”.

 #: src/project/sync/SyncStatusPrimitive.svelte
 msgid "Last sync: #"
-msgstr ""
+msgstr "Usawazishaji wa mwisho: #"
frontend/viewer/src/locales/fr.po (1)

601-604: Add French translation for “Last sync: #”.

 #: src/project/sync/SyncStatusPrimitive.svelte
 msgid "Last sync: #"
-msgstr ""
+msgstr "Dernière synchronisation : #"
frontend/viewer/src/project/sync/FwLiteToFwMergeDetails.svelte (3)

34-35: Avoid string-literal drift for auth status.

If LoginButton exports a status type, prefer reusing it here (e.g., type AuthStatus = ...) to keep both sides in sync.


62-83: Handle NotLoggedIn without server, add a11y, and simplify handler.

  • Gate on NotLoggedIn regardless of server, and show a fallback message if server is missing.
  • Add aria-label to the offline icon.
  • Pass the handler by reference.

Apply:

-      {#if syncStatus === SyncStatus.Offline}
-        <Icon icon="i-mdi-cloud-off-outline"  class="size-10 m-4" />
-      {:else if syncStatus === SyncStatus.NotLoggedIn && server}
-        <LoginButton
-          text={$t`Login`}
-          status={{loggedIn: false, server: server}}
-          statusChange={s => onLoginStatusChange(s)}/>
+      {#if syncStatus === SyncStatus.Offline}
+        <Icon icon="i-mdi-cloud-off-outline" class="size-10 m-4" aria-label={$t`Offline`} />
+      {:else if syncStatus === SyncStatus.NotLoggedIn}
+        {#if server}
+          <LoginButton
+            text={$t`Login`}
+            status={{ loggedIn: false, server }}
+            statusChange={onLoginStatusChange}/>
+        {:else}
+          <span class="text-sm text-foreground/80">{$t`Not logged in`}</span>
+        {/if}

54-60: PR objective mismatch: “Last change” vs “Last sync”.

This component still renders “Last change: #”, but the PR aims to use “Last sync: #”. If these dates are intended to represent last sync, update the label (and ensure the dates reflect sync events, not commit times).

-      <T msg="Last change: #">
+      <T msg="Last sync: #">

Repeat for both occurrences. Also confirm locale entries exist for the new message.

Also applies to: 89-95

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3bf7e37 and 548414b.

📒 Files selected for processing (9)
  • frontend/viewer/src/locales/en.po (3 hunks)
  • frontend/viewer/src/locales/es.po (3 hunks)
  • frontend/viewer/src/locales/fr.po (3 hunks)
  • frontend/viewer/src/locales/id.po (3 hunks)
  • frontend/viewer/src/locales/ko.po (3 hunks)
  • frontend/viewer/src/locales/ms.po (3 hunks)
  • frontend/viewer/src/locales/sw.po (3 hunks)
  • frontend/viewer/src/project/sync/FwLiteToFwMergeDetails.svelte (2 hunks)
  • frontend/viewer/src/project/sync/SyncStatusPrimitive.svelte (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-06-02T14:27:02.745Z
Learnt from: myieye
PR: sillsdev/languageforge-lexbox#1720
File: frontend/viewer/src/locales/es.json:1786-1790
Timestamp: 2025-06-02T14:27:02.745Z
Learning: Spanish locale file (frontend/viewer/src/locales/es.json) contains generated code that may have null line numbers in origin entries due to limitations in the code generation process.

Applied to files:

  • frontend/viewer/src/locales/es.po
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Build UI / publish-ui
  • GitHub Check: Build API / publish-api
  • GitHub Check: check-and-lint
  • GitHub Check: frontend
  • GitHub Check: frontend-component-unit-tests
  • GitHub Check: Build FW Lite and run tests
🔇 Additional comments (20)
frontend/viewer/src/locales/es.po (2)

641-645: Location mapping for “Local” looks right.

No change needed.


650-654: “Login” reference addition is fine.

Matches usage in both components.

frontend/viewer/src/locales/ms.po (2)

641-645: Dual context for “Local” is correct.


650-654: “Login” mapping moved — OK.

frontend/viewer/src/locales/id.po (2)

641-645: Added “Local” context — OK.


650-654: “Login” context addition — OK.

frontend/viewer/src/locales/ko.po (2)

641-645: “Local” extra location is fine.


650-654: “Login” mapping move — OK.

frontend/viewer/src/locales/sw.po (2)

641-645: “Local” extra location — OK.


650-654: “Login” mapping — OK.

frontend/viewer/src/locales/en.po (3)

596-599: New msgid “Last sync: #” added — OK.


636-640: “Local” now referenced here too — OK.


645-649: “Login” also referenced from FwLiteToFwMergeDetails — OK.

frontend/viewer/src/locales/fr.po (2)

641-645: “Local/Locale” mapping looks correct.


650-654: “Login/Connexion” mapping addition — OK.

frontend/viewer/src/project/sync/SyncStatusPrimitive.svelte (3)

53-54: Confirm intent: remote tab now displays even when offline.

Previously gated by server && !Offline. Ensure this UX change is deliberate.


138-139: Good: “Local” now localized.


145-148: Prop forwarding to details component — OK.

Matches the new public API on FwLiteToFwMergeDetails.

frontend/viewer/src/project/sync/FwLiteToFwMergeDetails.svelte (2)

11-13: Confirm SyncStatus is a runtime enum.

You compare against SyncStatus.Offline/NotLoggedIn in the template. Please verify SyncStatus is emitted at runtime (not just a type or erased const enum), otherwise these checks will fail.


15-36: LGTM on new props and defaults.

The additions (syncStatus, server, onLoginStatusChange with no-op default) look correct and safe.

Comment thread frontend/viewer/src/project/sync/SyncStatusPrimitive.svelte Outdated
Comment thread frontend/viewer/src/project/sync/SyncStatusPrimitive.svelte
@myieye myieye merged commit cb7bedf into develop Sep 15, 2025
30 checks passed
@myieye myieye deleted the sync-dialog-touch-ups branch September 15, 2025 10:44
@coderabbitai coderabbitai Bot mentioned this pull request Sep 17, 2025
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.

1 participant