Skip to content

fix(native): PR merges respect stacks and project defaults; live refreshes and review follow-ups - #46

Merged
rynfar merged 5 commits into
nativefrom
nw/w10-fixes
Nov 2, 2026
Merged

rynfar merged 5 commits into
nativefrom
nw/w10-fixes

Conversation

@rynfar

@rynfar rynfar commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Fixes the review findings on the pull requests page (#36), two of which let merges reach real PRs wrongly.

Merges (P1)

  • Project merge method. Merges resolve current pick → project default → last pick like resolvePullRequestMergeMethod. The project default comes from server settings (projectSettingsOverrides[p].pullRequestMergeMethod, null included, else the environment's). Applies to quick merges too.
  • Stacks. Where the host runs stack actions (capabilities.stacks && stackActions), the detail reads pullRequests.stack: single merges wait ("Checking stack membership…" / "Couldn't check stack membership" + Retry stack lookup), and a stacked PR shows Merge stack instead. That sends stackNumber + expectedStackHeads for the unmerged layers through this one (PullRequestStackMenu), and refuses when a layer is closed, a draft, or has no head. Every single merge (quick or detail) re-reads the detail fresh and refuses if a stack exists ("Open this pull request to merge its stack."), as client-runtime runAction does.
  • Quick merges are no longer marked merged; toasts use actionSuccessLabels ("Merge requested") and failures actionFailureLabels. The detail shows no success toasts, like the web.

Freshness and lists (P2)

  • Follows pullRequests.subscribeRefreshes while the page is open and connected. A new epoch re-reads the list (rows added by cursors are kept), listStats and the open detail. Reopening the page or reconnecting re-reads both.
  • "Refresh from host" sends pullRequests.invalidate({ reference }). Update-branch and approve-workflows refresh from the host afterwards.
  • Rows an action moves out of the state filter leave the list.
  • listStats goes out in batches of 500 for every row.
  • Code tab: the cursor is kept, and the next slice loads when the end comes within 240px (on scroll, or after a slice that doesn't fill the panel). Each slice is parsed once on the network runtime, and the parses are joined there. The 10-slice cap is gone.
  • GitCafe: bare numbers resolve (/pulls/<n>). git.cafe and staging.git.cafe claim /pull(s)/<n> first, and their links are canonicalized.

P3 / risks

  • Query parsing follows JS: \s (U+FEFF separates, U+0085 does not); a quoted \r/U+2028/U+2029 keeps the token as text; bounds count UTF-16 units like slice. The source's limit is MAX_QUALIFIER_LENGTH = 200; the 100 limit belongs to filterOptions queries, which native doesn't send. The list query is now cut to 200 UTF-16 units, so emoji can't exceed the contract.
  • The sidebar PR/Back item is a tab stop; Enter and Space press it.
  • PR writes go through one FIFO lane (a merge's fresh reads included), and one pending guard per PR is shared by rows and detail.
  • Confirmations only fire on a second click of the same control. They disarm on Escape (intercepted app-wide), on a press outside the armed control, on window blur, on tab, page or connection change, and when the armed control stops rendering. Menu-armed Merge now / Close show an inline confirm chip.

Deviations

  • Merge stack uses the inline two-step confirm instead of the web's dialog. Stack rebase and the stack menu aren't ported (PR-DETAIL stays partial).

Evidence

  • Tests (failing first): merge_method_prefers_current_then_project_default_then_last_selected, a_stack_owns_merging_where_the_host_runs_stack_actions, stack_merge_scopes_the_layers_through_this_one (payload), project_default_merge_method_reads_the_override_then_the_environment, stats_are_read_in_batches_of_five_hundred, list_query_stays_within_the_contract_in_utf16_units, invalidate_names_the_pull_request, shown_groups_drop_rows_an_action_moved_out_of_the_state_filter, separators_are_javascripts_whitespace, a_quoted_line_break_keeps_the_token_as_text, bounds_count_utf16_units_as_slice_does, gitcafe_resolves_bare_numbers_and_claims_its_own_hosts. No mutation was run against any server.
  • Read-only probe on the dev server (pr_probe --state all):
subscribeRefreshes: no refresh yet (epoch 0)
list: 99 on the wire, 99 decoded, 2 providers, 2 errors, truncated=true
listStats: 99 rows measured
pull request pingdotgg/t3code #29248: …
  stack: Some(Ok(None)) gate=MergeGate { single: true, stack_owns: false, blocked: None }
  detail: Open draft=false +593 -54 files=16 checks=26 labels=2 reviewers=0 primary=None
  diff: 50666 bytes, 16 files, truncated=false, more=false
  • Offscreen snapshots, using the new --pull-requests / --pull-request <n> [--pull-request-tab code] flags:
    • /private/tmp/claude-501/-Volumes-DevSSD-t3code/7a9093f7-05bd-4183-ab15-c4265aa48126/scratchpad/w10b-pr-list.png
    • /private/tmp/claude-501/-Volumes-DevSSD-t3code/7a9093f7-05bd-4183-ab15-c4265aa48126/scratchpad/w10b-pr-detail.png
    • /private/tmp/claude-501/-Volumes-DevSSD-t3code/7a9093f7-05bd-4183-ab15-c4265aa48126/scratchpad/w10b-pr-code.png
  • Gates: cargo test --workspace, clippy -D warnings (with and without --features snapshot), gen-theme --check, parity sync test, conformance --check.

Opus 5.5 via Claude Code (worker W10b).

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.

1 participant