Skip to content

Add single-column layout toggle for adaptive feed list#1

Merged
davezig merged 10 commits into
mainfrom
claude/rss-reader-layout-research-irv2Q
Jul 6, 2026
Merged

Add single-column layout toggle for adaptive feed list#1
davezig merged 10 commits into
mainfrom
claude/rss-reader-layout-research-irv2Q

Conversation

@davezig

@davezig davezig commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a user-configurable preference to force single-column layout in the feed list, enabling better control over the adaptive two-pane layout on tablets. This is particularly useful for users who prefer a single-column view even on larger screens.

Key Changes

  • New Preference Class: FlowSingleColumnPreference sealed class with ON/OFF states, following the existing preference pattern with DataStore integration
  • Settings Integration: Added flowSingleColumn field to Settings data class and registered the DataStore key in DataStoreExt.kt
  • UI Control: Added toggle switch in FeedsPageStylePage under a new "Layout" section to allow users to enable/disable single-column mode
  • Adaptive Layout Logic: Updated AppEntry.kt to:
    • Observe the preference via snapshotFlow
    • Compute scaffoldDirective with maxHorizontalPartitions = 1 when single-column is enabled (portrait only)
    • Trigger navigator navigation on preference changes to force layout recomputation
  • Composition Local: Exposed preference via LocalFlowSingleColumn for access throughout the compose tree
  • Version Bump: Updated app version from 0.16.1 (code 46) to 0.16.2 (code 47)

Implementation Details

The single-column preference only applies in portrait orientation (screenWidthDp <= screenHeightDp). In landscape, the adaptive layout operates normally, allowing two panes on tablets. A LaunchedEffect in AppEntry.kt watches the preference and calls navigator.navigateTo(List) when it changes—this is necessary because the navigator only recomputes scaffoldValue on navigation events, not on directive-only changes.

The preference follows the established pattern: sealed class with put() and fromPreferences() methods, DataStore key registration, and integration into the settings provider's CompositionLocal chain.

Localization

Includes string resource updates across multiple languages (Swedish, German, Arabic, Turkish, Latvian, Galician, Korean) with improved phrasing and consistency.

Additional Files

  • Added CLAUDE.md with project architecture documentation for development context

https://claude.ai/code/session_01DJ46HYUPdGBeDXuYgrqGNB

jim-daf and others added 10 commits May 15, 2026 12:00
Currently translated at 52.8% (198 of 375 strings)

Translated using Weblate (Arabic)

Currently translated at 100.0% (375 of 375 strings)

Translated using Weblate (Galician)

Currently translated at 99.4% (373 of 375 strings)

Translated using Weblate (Turkish)

Currently translated at 97.3% (365 of 375 strings)

Translated using Weblate (Korean)

Currently translated at 49.8% (187 of 375 strings)

Translated using Weblate (German)

Currently translated at 100.0% (375 of 375 strings)

Translated using Weblate (Swedish)

Currently translated at 100.0% (375 of 375 strings)

Translated using Weblate (Arabic)

Currently translated at 100.0% (375 of 375 strings)

Co-authored-by: Daniel Wiik <d.wiik@outlook.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Kachelkaiser <kachelkaiser@htpst.de>
Co-authored-by: ODK <vekilince@proton.me>
Co-authored-by: Yago Raña Gayoso <yago.rana.gayoso@gmail.com>
Co-authored-by: clearstripe <sakurasan000510@gmail.com>
Co-authored-by: jonnysemon <jonnysemon@users.noreply.hosted.weblate.org>
Co-authored-by: ℂ𝕠𝕠𝕠𝕝 (𝕘𝕚𝕥𝕙𝕦𝕓.𝕔𝕠𝕞/ℂ𝕠𝕠𝕠𝕝) <coool@mail.lv>
Translate-URL: https://hosted.weblate.org/projects/readyou/android-strings/ar/
Translate-URL: https://hosted.weblate.org/projects/readyou/android-strings/de/
Translate-URL: https://hosted.weblate.org/projects/readyou/android-strings/gl/
Translate-URL: https://hosted.weblate.org/projects/readyou/android-strings/ko/
Translate-URL: https://hosted.weblate.org/projects/readyou/android-strings/lv/
Translate-URL: https://hosted.weblate.org/projects/readyou/android-strings/sv/
Translate-URL: https://hosted.weblate.org/projects/readyou/android-strings/tr/
Translation: ReadYou/Android strings
…id-strings

Translations update from Hosted Weblate
Adds a user preference to force single-column mode on tablets/large
screens. When enabled, the 2-pane adaptive layout collapses to a single
column where tapping an article takes over the full screen and back
returns to the article list. Default is off (adaptive behavior unchanged).

- FlowSingleColumnPreference: new boolean preference (ON/OFF)
- DataStoreExt: register key "flowSingleColumn" in both PreferencesKey and legacy DataStoreKey
- Settings/Preference/SettingsProvider: wire preference through the settings system
- AppEntry: override scaffold directive with maxHorizontalPartitions=1 when enabled
- FeedsPageStylePage: add "Layout" section with toggle switch
- strings.xml: add single_column_layout and layout string resources

https://claude.ai/code/session_01DJ46HYUPdGBeDXuYgrqGNB
The navigator's scaffoldValue only recomputes on navigation events, not
when scaffoldDirective alone changes. Without a navigation event, isTwoPane
stays stale after toggling, requiring a rotation or app restart to take effect.

Add a LaunchedEffect that watches forceSingleColumn via snapshotFlow and
navigates to the List pane on every change (after initial composition),
triggering the navigator to recompute scaffoldValue with the updated directive.

https://claude.ai/code/session_01DJ46HYUPdGBeDXuYgrqGNB
Covers build setup, architecture overview, preferences system pattern,
adaptive layout notes (including the single-column toggle behavior),
key libraries, and branch naming convention.

https://claude.ai/code/session_01DJ46HYUPdGBeDXuYgrqGNB
When the single-column preference is enabled, only force maxHorizontalPartitions=1
in portrait. In landscape (screenWidthDp > screenHeightDp) the adaptive directive
is used as-is, so a tablet rotated sideways naturally shows the two-pane view.

https://claude.ai/code/session_01DJ46HYUPdGBeDXuYgrqGNB
@davezig davezig merged commit 6aa9f0b into main Jul 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants