Skip to content

fix[mobile]: task bug#2631

Merged
peterchinman merged 1 commit into
mainfrom
peter/mobile-task-bug
Apr 16, 2026
Merged

fix[mobile]: task bug#2631
peterchinman merged 1 commit into
mainfrom
peter/mobile-task-bug

Conversation

@peterchinman
Copy link
Copy Markdown
Contributor

we were not filtering the background mobile splits out when we attempted to reconcile the splits against url state

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 16, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Fixed layout reconciliation to properly preserve excluded items in their intended positions when content changes occur via URL navigation.
    • Enhanced back-navigation validation to verify the background split exists before allowing users to navigate backward.

Walkthrough

Updated split layout reconciliation logic to preserve excluded splits by deriving comparisons from visibleSplits instead of all splits. Enhanced mobile back-navigation validation to verify the background split exists in the split manager before allowing navigation.

Changes

Cohort / File(s) Summary
Split Reconciliation
js/app/packages/app/component/split-layout/layoutManager.ts
Modified reconcileSplits to use visibleSplits for comparisons and preserve excluded splits unchanged during content-key reconciliation by reconstructing resultSplits with proper index tracking.
Mobile Back Navigation
js/app/packages/app/component/split-layout/mobile/createMobileSwipeLayout.ts
Enhanced canGoBack() with additional existence check to validate that the background split exists in splitManager before enabling back-navigation.

Possibly related PRs

🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title uses the conventional commits format (fix:) and is under 72 characters, but 'task bug' is vague and doesn't clearly convey the specific issue being fixed. Revise the title to be more descriptive, such as 'fix[mobile]: filter background splits during reconciliation' to clearly indicate what bug is being addressed.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly relates to the changeset by explaining the core issue: background mobile splits not being filtered during split reconciliation against URL state.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
js/app/packages/app/component/split-layout/layoutManager.ts (1)

942-966: ⚠️ Potential issue | 🟡 Minor

Edge case to confirm: URL returning to content matching excluded split.

If newSplits contains content matching the currently-excluded split (e.g., browser back to a URL whose segment corresponds to the background split on mobile), reconcileSplits will create a fresh split for that content while preserving the excluded split, resulting in two splits in state.splits with the same (type, id) — one excluded, one not. This breaks assumptions in getSplitByContent (which filters to non-excluded only), duplicate-detection, and potentially the swipe-back flow.

This isn't a regression introduced by the diff, and it may be intentionally out of scope, but the navigationInterceptor only guards programmatic navigation — not browser back or manual URL entry. Worth confirming whether URL-based navigation to excluded content is expected/acceptable behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@js/app/packages/app/component/split-layout/layoutManager.ts` around lines 942
- 966, reconcileSplits can create a duplicate of an already-excluded split when
URL/navigation returns to that content; update reconcileSplits to detect and
reuse an existing split even if it's currently excluded instead of building a
fresh one: when iterating newSplits, if sameContent matches a split in
state.splits that is excluded, reuse that split (clear or update its excluded
state so it becomes visible), reuse its id and add to usedIds, and push it into
resultSplits; adjust the reuse logic around buildSplit and the check that
currently only inspects visibleSplits so it queries state.splits (or calls
getSplitByContent with an includeExcluded option) to avoid producing duplicate
(type,id) entries and to keep swipe/back flows consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@js/app/packages/app/component/split-layout/layoutManager.ts`:
- Around line 942-966: reconcileSplits can create a duplicate of an
already-excluded split when URL/navigation returns to that content; update
reconcileSplits to detect and reuse an existing split even if it's currently
excluded instead of building a fresh one: when iterating newSplits, if
sameContent matches a split in state.splits that is excluded, reuse that split
(clear or update its excluded state so it becomes visible), reuse its id and add
to usedIds, and push it into resultSplits; adjust the reuse logic around
buildSplit and the check that currently only inspects visibleSplits so it
queries state.splits (or calls getSplitByContent with an includeExcluded option)
to avoid producing duplicate (type,id) entries and to keep swipe/back flows
consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5a50c47f-7fd9-4745-b957-c8ca8716a575

📥 Commits

Reviewing files that changed from the base of the PR and between 6567b10 and 5ff1af3.

📒 Files selected for processing (2)
  • js/app/packages/app/component/split-layout/layoutManager.ts
  • js/app/packages/app/component/split-layout/mobile/createMobileSwipeLayout.ts

@peterchinman peterchinman merged commit 8cdb6bc into main Apr 16, 2026
24 checks passed
@peterchinman peterchinman deleted the peter/mobile-task-bug branch April 16, 2026 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant