mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-12 01:07:46 +00:00
refactor(dm): extract the history status card to commons (shared with desktop)
Phase 2 (UI), stage 2. Move DmHistoryLoadingCard + its tap-through per-relay dialog + the historySubtitle/incompleteSubtitle helpers out of amethyst into commons/commonMain (com.vitorpamplona.amethyst.commons.ui.feeds), so the same "older history / all caught up / some relays didn't respond" boundary card can back any per-relay BackwardRelayPager feed on Android and Desktop. The card's localized date formatting (SimpleDateFormat/Locale) can't live in commons commonMain (it targets iOS/linux/macOS, no java.*), so it's injected as a formatReachDate: (epochSeconds) -> String lambda — the platform that renders the card supplies its native formatter, no i18n regression. Android passes formatHistoryReachDate (new HistoryDateFormat.kt). The dialog's per-relay reach now uses that same month-precision formatter (was "MMM d, yyyy", now "MMM yyyy") — a negligible cosmetic change. Its ~11 strings move to commons composeResources, including the module's first <plurals> (chats_history_relays). The three Android call sites (ChatroomView, ChatroomListFeedView, LoadingReplyNote) now import the shared card/helpers and pass the formatter; no behaviour change. The old amethyst string copies are left in place (harmless, separate resource namespace) for a later cleanup pass.
This commit is contained in:
@@ -55,6 +55,21 @@
|
||||
<string name="accessibility_user_avatar">User avatar</string>
|
||||
<string name="accessibility_navigate">Navigate</string>
|
||||
|
||||
<!-- Relay history paging (shared feed markers) -->
|
||||
<!-- Relay history paging (shared feed markers + status card) -->
|
||||
<string name="chats_history_relay_sync">Relay sync:</string>
|
||||
<string name="chats_history_older">Older %1$s messages</string>
|
||||
<string name="chats_history_all_caught_up">All caught up</string>
|
||||
<string name="chats_history_reached_start">Reached the start of your %1$s messages</string>
|
||||
<string name="chats_history_subtitle">%1$s · %2$s · back to %3$s</string>
|
||||
<string name="chats_history_subtitle_no_date">%1$s · %2$s</string>
|
||||
<string name="chats_history_waiting">waiting on %1$s</string>
|
||||
<string name="chats_history_incomplete">Some relays didn\'t respond</string>
|
||||
<string name="chats_history_incomplete_sub">%1$s unreachable · tap to see which</string>
|
||||
<string name="chats_history_relays_title">%1$s · history by relay</string>
|
||||
<string name="chats_history_relay_back">back to %1$s</string>
|
||||
<string name="action_dismiss">Dismiss</string>
|
||||
<plurals name="chats_history_relays">
|
||||
<item quantity="one">%1$d relay</item>
|
||||
<item quantity="other">%1$d relays</item>
|
||||
</plurals>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user