RS Post List: Bridge posts to FluxC for editor opening#22794
RS Post List: Bridge posts to FluxC for editor opening#22794
Conversation
When a user taps a post in the RS post list, the editor needs the post in FluxC's local database. This adds a bridge that fetches the post via wordpress-rs, maps it to a PostModel, and inserts it into FluxC's DB before opening the editor. Includes a fast path that skips the network call when FluxC already has the post cached. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Generated by 🚫 Danger |
|
|
|
|
- Remove unused PostModel import - Extract bridgePostOrNull() from moveToDraftAndEdit() to reduce line count - Suppress CyclomaticComplexMethod on PostRsListScreen composable Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #22794 +/- ##
==========================================
- Coverage 37.31% 37.29% -0.03%
==========================================
Files 2324 2326 +2
Lines 124714 124849 +135
Branches 16922 16961 +39
==========================================
+ Hits 46542 46563 +21
- Misses 74418 74514 +96
- Partials 3754 3772 +18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The custom exception type was never used for branching — all callers catch generic Exception. Use the standard IllegalStateException instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The class is stateless so the default unscoped binding is fine. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This comment was marked as resolved.
This comment was marked as resolved.
Use PostRsRestClient.fetchTermNames() to look up tag names from tag IDs so posts opened via wordpress-rs show their tags in the editor. Also replace throw IllegalStateException with error() in PostRsFluxCBridge to satisfy detekt UseCheckOrError rule. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
I tested the changes, and when loading a post, I can tap on another one, and both are opened. Is that expected? On the other hand, Claude highlighted this one:
|
Add an early return in openPost() when _isOpeningPost is already true, so a second tap while the first post is still loading is ignored. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Thread lastModified from the RS list UI model through to the bridge so it can compare against the cached FluxC row's remoteLastModified. When they differ the fast path is skipped and the post is re-fetched. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The CircularProgressIndicator overlay did not block taps, so users could interact with the list underneath while a post was loading. Add a no-op clickable modifier so the overlay consumes all touches. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>


Description
When a user taps a post in the RS post list, the editor loads the post from FluxC's local SQLite database. Since RS posts are fetched via
wordpress-rsand never go through FluxC, the editor can't find them. This PR bridges the gap by:retrieveWithEditContext, mapping it to a FluxCPostModel, and inserting it into FluxC's DBTesting instructions
Open post for editing:
Offline: