Skip to content

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

Open
davezig wants to merge 8 commits into
ReadYouApp:mainfrom
davezig:main
Open

davezig wants to merge 8 commits into
ReadYouApp:mainfrom
davezig:main

Conversation

@davezig

@davezig davezig commented Aug 21, 2026

Copy link
Copy Markdown

No description provided.

claude and others added 8 commits June 23, 2026 15:35
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
…irv2Q

Add single-column layout toggle for adaptive feed list
Synchronize README-zh-TW and enhance RSS discovery features
* Fix mark-as-read-on-scroll never reaching the last screenful

The last items in the article list had no scroll distance left to pass
above the viewport's top edge once the list was fully scrolled, so they
could never satisfy the "scrolled past the first visible item" read
condition.

Add a trailing Spacer sized to the live-measured height of the Box
wrapping the LazyColumn (via onSizeChanged), giving the list enough
extra scroll range for the last item to reach the same read line as
every other item. The spacer is unconditional and independent of the
existing FAB/bottom-bar clearance spacers.

* Fix trailing articles never being marked read on scroll

The trailing spacer added to fix the scroll-boundary bug let the list
scroll past the last real article, but once no item with
contentType == CONTENT_TYPE_ARTICLE remained visible, firstItemKey
became null and the read-detection loop never matched it, so found
stayed false and the whole batch of trailing articles was silently
discarded instead of committed as read.

Treat firstItemKey == null as every remaining article having already
scrolled past the read line, matching the same "read line" semantics
used for every other item in the list.

---------

Co-authored-by: Claude <noreply@anthropic.com>

@ibrahim-iqbal ibrahim-iqbal 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.

Read through end-to-end. Core idea is good and the toggle wiring itself is clean; a few structural things worth surfacing before it lands.

The single-column toggle itself — clean.

  • FlowSingleColumnPreference follows the existing preference pattern (companion default, put, DataStore key, LocalFlowSingleColumn composition local). No new machinery.
  • In AppEntry the override is scoped to portrait only (isLandscape = screenWidthDp > screenHeightDp), which is the right call — landscape typically has room for the two-pane layout and forcing single-column there would be a foot-gun.
  • Using calculatePaneScaffoldDirective(...).copy(maxHorizontalPartitions = 1) is the correct adaptive-API surface for this override rather than reimplementing the directive from scratch.

Two things worth flagging:

  1. Scope creep — the FlowPage.kt changes are a separate fix. The trailing Spacer(viewport-height) + the firstItemKey == null initialisation flip in the "found" loop is a mark-as-read-on-scroll bug fix that has nothing to do with the single-column toggle. It looks correct (the comment explaining firstItemKey == null is spot on — a viewport with only the trailing spacer visible currently treats nothing as read). But it should really be a second PR; a reviewer looking at this later to understand the toggle will be confused why a spacer was added to FlowPage, and if the mark-as-read change needs to be reverted it drags the toggle with it. Even splitting it into a follow-up commit in the same PR with a clear message would help.
  2. CLAUDE.md at the repo root. A per-project AI-context file is fine for local use, but committing it into main is a project-policy call the maintainer should make explicitly — the repo doesn't currently carry any of the equivalent .cursorrules / AGENTS.md / .aider.conf files, so this would set a precedent. Suggest either dropping it from this PR and gitignoring it, or opening a separate one-file PR that just asks the maintainer whether they want that convention in the repo.

Small things:

  • LocalConfiguration.current.screenWidthDp > screenHeightDp — works for the common case. Foldables with unusual aspect ratios or half-folded states may report screen dimensions that don't match the user's perception of "landscape". Not a blocker; matches how the rest of the codebase reads orientation.
  • The PR body is currently empty. Even a two-line summary ("Adds a settings toggle to force single-column in portrait, mirrors sync-URL style row") would speed up review considerably.

Toggle change LGTM once split from the FlowPage fix and the CLAUDE.md question.

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.

3 participants