feat: support manual ordering of groups and feeds - #1326
Open
mlkgrnt wants to merge 3 commits into
Open
Conversation
- draggable reordering of groups and feeds (Reorderable 3.1.0) - create empty group via the + button in the feeds page title row - data layer: position column with SQL DEFAULT on Feed and Group, AutoMigration 7 -> 8, secondary constructor updated to keep Room constructor matching working
…rrow top bar - intercept system back in reorder mode: if the order was changed show a save/discard dialog, otherwise exit reorder mode instead of moving the app to background - replace the feeds-page top bar (settings and add-subscription buttons) with a back arrow and Reorder title while reorder mode is active - drop the redundant drag-handle icon from the reorder toolbar
The feeds page hides the special default group (the catch-all for uncategorized feeds) once it becomes empty, but the move-subscription target lists in the feed and group option drawers still listed every group via pullGroups(), so the invisible default group could be picked as a move target and would then reappear on the feeds page. Align the two drawers with the feeds-page rule by deriving the group list from pullFeeds() and dropping the default group while it has no feeds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: feat: support manual ordering of groups and feeds
Problem
Groups and feeds always render in a fixed order (the order they were created in the database), with no way for the user to arrange them. Once a user subscribes to many feeds, the list becomes hard to scan and important groups/feeds cannot be surfaced to the top. There is also no way to create an empty group to organize feeds into before subscribing to anything.
Changes
UI: drag-and-drop reordering (
FeedsReorderMode.kt, new)Icons.Rounded.SwapVert). Tapping it switches the content intoFeedsReorderMode.rememberReorderableLazyListState(lazy list variant).ReorderableColumnwith a handle on each feed row.reorder_tips) and a Done button to exit reorder mode and persist the new order.sh.calvin.reorderable:reorderable:3.1.0(KMP library; the Android artifact resolves through itsreorderable-androidvariant).UI: create empty group
Icons.Rounded.Add) that opens a name dialog (TextFieldDialog), letting the user create an empty group before adding any feeds. (Previously groups could only be created implicitly when subscribing a feed.)Data layer
FeedandGroupentities gain aposition: Intcolumn with@ColumnInfo(defaultValue = "0")so the SQL-level default satisfies theAutoMigrationfrom schema 7 → 8 (a NOT NULL column without a default would fail migration).Feed's secondary constructor was extended withpositionto keep Room's constructor matching working (the primary constructor carries@Ignore importantand therefore never matches the column set directly).AndroidDatabaseversion bumped 7 → 8 with the exported8.jsonschema.ViewModel
FeedsViewModelgainsaddGroup(name),reorderGroups(ids), andreorderFeeds(groupId, ids)which update thepositioncolumns transactionally.Verification
:app:compileGithubReleaseKotlin— BUILD SUCCESSFUL:app:testGithubReleaseUnitTest(same command the upstream CI runs) — BUILD SUCCESSFUL, all tests green