Skip to content

fix: use configured branch in repository browse - #2348

Merged
integry merged 4 commits into
integry:mainfrom
nrdgrrrl:fix/browse-configured-branch-clean
Sep 16, 2026
Merged

integry merged 4 commits into
integry:mainfrom
nrdgrrrl:fix/browse-configured-branch-clean

Conversation

@nrdgrrrl

@nrdgrrrl nrdgrrrl commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Rebuilt the original Repository Browse branch fix on current origin/main and completed branch identity handling across repository Browse, standalone summary routes, notification links, summary API requests, and GitHub file links.

Branch behavior

Browse resolves its branch as: explicit ?branch= request, then configured repository baseBranch, then the existing API/GitHub HEAD fallback when neither is available. Branches are URL-encoded in API queries and navigation links.

Changes

  • pass configured branches through the Repositories workspace and standalone /summaries/:owner/:repo route
  • preserve indexing-notification branches in Inbox, web-push, and voice deep links
  • pass branch through status, directory-tree, path-summary, and recursive full-tree API calls
  • reset repository/branch-scoped tree, selection, status, loading, and error state
  • guard root and expanded-child responses with a Browse-scope generation token
  • make Open on GitHub use the displayed branch, with legacy HEAD only when no branch resolves

Validation

  • focused UI regressions: 15 passed
  • UI typecheck, lint, and production build passed
  • API typecheck, lint, and build passed
  • git diff --check passed

The server notification integration tests were not executed because this task explicitly prohibits touching SQLite or Redis.

@integry integry added the AI label Sep 12, 2026
@integry

integry commented Sep 12, 2026

Copy link
Copy Markdown
Owner

/review fable

@propr-dev

propr-dev Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Code Review — fable

Overall Evaluation

This PR fixes a real bug: the Browse tab was calling /status and /tree without the repository's configured branch, so the backend fell back to HEAD and reported "Repository Not Indexed" for repos indexed on main. The fix is minimal and correctly scoped — an optional branch prop is threaded RepoActionContainer → RepoBrowsePanel → SummaryBrowser, and summaryApi.ts appends ?branch=<encoded> only when a non-empty branch is supplied. The PR is ready to merge within its stated scope.

✅ Fallback behavior preserved — propr-ui/src/api/summaryApi.ts builds branchQuery with branch ? \?branch=${encodeURIComponent(branch)}` : '', so both undefinedand an empty-stringbaseBranchproduce the exact pre-PR URL. The second test insummaryApi.test.tsexplicitly asserts no?branch=` appears in that case.

✅ Effect and callback dependencies updated correctly — SummaryBrowser/index.tsx adds branch to both the useEffect deps (initial status/root fetch) and the toggleDirectory useCallback deps, so a branch change triggers a refetch and nested-directory expansion uses the current branch rather than a stale closure.

✅ Branch value is URL-encoded — encodeURIComponent(branch) handles branch names like release/2.x or feature#123 safely in the query string.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Propagate branch to getPathSummary too

getPathSummary in propr-ui/src/api/summaryApi.ts is unchanged and still has no branch parameter, and SummaryPanel (rendered from SummaryBrowser/index.tsx with only owner/repo) therefore fetches /summary/:path without the branch. If the backend's summary endpoint also falls back to HEAD when no branch is provided, users on a main-indexed repo will now see the tree but may get a missing/incorrect summary when clicking an entry. This is pre-existing and explicitly outside the stated objective ("indexing-status and directory-tree requests"), so it is not a blocker, but it is the natural next step to make Browse fully consistent. getFullTree has the same gap for its internal getDirectoryTree call.

S2: 🟢 Reset tree state when branch changes

SummaryBrowser/index.tsx refetches root entries when branch changes, but nodeStates and selectedEntry are not cleared, so previously expanded directories could retain children fetched for a different branch. In practice this is mitigated because RepoActionContainer unmounts RepoBrowsePanel when leaving the Browse tab, and the same limitation already exists for owner/repo changes, so this is optional hardening. A small setNodeStates({}); setSelectedEntry(null); at the top of fetchInitialData would close the gap.

S3: 🟢 Add a component-level regression test

Coverage is at the API-URL layer only. An optional SummaryBrowser render test that mocks getIndexingStatus/getDirectoryTree and asserts they are called with branch (including on nested expansion) would guard against a future refactor dropping the prop somewhere in the RepoBrowsePanel → SummaryBrowser chain, which the current tests cannot detect.

Score

The change is small, correct, matches the stated objective exactly, preserves fallback behavior, updates React dependency arrays properly, and adds focused regression tests; the only gaps are adjacent pre-existing ones outside scope.

Score: 8/10


🤖 Review Details

  • Model: Claude Fable 5.1
  • Time: 31s
  • Tokens: 20,864 (18,480 in / 2,384 out)
  • Cost: $0.35

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@integry

integry commented Sep 13, 2026 •

Copy link
Copy Markdown
Owner

Codex review:

The fix is sound, but branch identity still isn’t carried through the whole browsing experience. At 849f35d, I found three concrete gaps:

  1. Notification links still reach the broken path. The standalone /summaries/:owner/:repo page renders SummaryBrowser without a branch. Inbox links navigate there, so Browse can work from Repositories while opening an indexing notification still shows “Repository Not Indexed.” Resolve
    the configured branch there too, and preserve an explicit branch in links where available. Standalone page, inbox links.

  2. Cached content can belong to the previous repository or branch. The effect reloads status and root entries, but does not clear expanded-directory children or the selected summary. Requests also have no cancellation or stale-response guard. Switching repositories—or changing the
    configured branch—can mix old summaries into the new tree. Scope browser state to (owner, repo, branch) and prevent previous requests from updating it. Browser state and fetching.

  3. “Open on GitHub” still hardcodes HEAD. A summary loaded from release/foo can open a file on the default branch, showing different content or a missing file. Pass the branch into SummaryPanel; ideally link to the indexed commit when users should see the version being summarized.
    GitHub link.

Two broader follow-ups would make this more durable:

  • Centralize branch resolution. The server treats omitted branch as the literal database key HEAD. Consider one explicit rule—requested branch, otherwise configured branch, otherwise the legacy fallback—shared across status, tree, and individual-summary endpoints. getPathSummary() and
    getFullTree() also still lack branch parameters, although I found no current UI callers.

  • Make indexing state branch-specific in the UI. Display the branch and distinguish “this branch has no index,” “indexing,” and “failed.” The current generic instruction to enable summarization can be misleading when it is already enabled.

I’d add component regressions for notification navigation, repository/branch switching with delayed responses, and GitHub link targets. The new URL tests don’t exercise those paths.

Repository owner deleted a comment from propr-dev Bot Sep 13, 2026
propr-dev Bot pushed a commit that referenced this pull request Sep 14, 2026
…sistent routing, exact source-SHA preservation, contributor attribution, and destination-aware comments. Final-push denial publishes the existing implementation commits. Original PRs remain open.

Implemented permission-based continuation handling with persistent routing, exact source-SHA preservation, contributor attribution, and destination-aware comments. Final-push denial publishes the existing implementation commits. Original PRs remain open.

Validation passed: build, typecheck, focused ESLint, and 55 tests. Live Git dry runs succeeded for #2348 and #2393 using the worker-provided installation token.

Changes are uncommitted. No PR or preview files were created.

PR: #2393
Comment by: @integry (ID: 5661663400)
Model: gpt-6-astra
@nrdgrrrl
nrdgrrrl force-pushed the fix/browse-configured-branch-clean branch from 849f35d to 3c89720 Compare September 14, 2026 23:16
Repository owner deleted a comment from propr-dev Bot Sep 14, 2026
@integry

integry commented Sep 16, 2026

Copy link
Copy Markdown
Owner

/review fable codex

@propr-dev

propr-dev Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ AI Code Review Complete requested by @integry

Posted 2 reviews:

View Task Details

@propr-dev

propr-dev Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Code Review — fable

Overall Evaluation

This PR threads branch identity through the Summary Browser end to end: the Repositories workspace passes baseBranch into RepoBrowsePanel, the standalone /summaries/:owner/:repo route resolves ?branch= → configured baseBranch → legacy HEAD, the three notification link builders (Inbox, web-push, voice briefing) preserve target.branch, the summary API client forwards an encoded branch query on every request, and SummaryBrowser now resets its scoped state and guards late responses with a generation token. The approach is localized, consistent across entry points, and well covered by new focused tests. Both gaps raised in the previous Codex review (standalone/inbox links and stale cross-scope content) are addressed in the current diff.

✅ Scope isolation is actually enforced, not just remounted — propr-ui/src/components/SummaryBrowser/index.tsx clears indexingStatus, rootEntries, nodeStates, selectedEntry, and error at the top of the scope effect and checks isCurrent() / requestGenerationRef after every await, including expanded-child loads; index.test.tsx verifies late root and child responses from a previous (owner, repo, branch) are dropped using deferred promises rather than relying on the key remount in the parents.

✅ Single resolution rule shared by all entry points — propr-ui/src/utils/summaryBrowser.ts centralises normalizeSummaryBranch / resolveSummaryBranch / summaryBrowserPath, and SummaryBrowserPage.tsx sets state in the right order (setConfiguredBranches before setBranchConfigReady) so the browser never mounts with the legacy branch and then remounts with the configured one.

✅ GitHub link hardening beyond the objective — SummaryPanel.tsx now percent-encodes owner, repo, branch, and each path segment individually, closing a pre-existing unencoded-path issue while switching from HEAD to the displayed branch.

I found no PR-introduced correctness regression in the changed code. However, the current head reports a failed Validate Changes check that I cannot trace to a specific changed line from the diff alone, so the PR cannot be called merge-ready until that is resolved. Verdict: needs minor changes (resolve/explain the failing check).

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Investigate the failed Validate Changes check

The head has one failing check while Run Full Test Suite, Analyze JavaScript and TypeScript, and the build matrix pass. Nothing in the diff obviously explains it, but plausible candidates are a lint rule such as max-lines (the repo uses /* eslint-disable max-lines */ elsewhere and SummaryBrowser/index.tsx grew by ~35 lines), or a vi.mock factory in SummaryBrowserPage.test.tsx that omits an export a transitive import needs (the ../api/proprApi mock only exposes getAvailableGithubRepos and getInstanceCatalog). Please attach the log or fix; this is the only thing standing between the PR and merge readiness.

S2: 🟢 Verify GitHub accepts a percent-encoded slash in the ref segment

propr-ui/src/components/SummaryBrowser/SummaryPanel.tsx builds blob/release%2F2026%20Q1/README.md. GitHub generally decodes %2F in tree/blob URLs, but its canonical form uses a literal / and relies on ref/path disambiguation. If any environment (proxy, GitHub Enterprise) fails to resolve the encoded form, consider encoding the branch per-segment (branch.split('/').map(encodeURIComponent).join('/')) the same way the path is handled. Optional because the HEAD fallback still works and the behaviour is very likely correct on github.com.

S3: 🟢 Standalone page can hang behind the catalog fetch

propr-ui/src/pages/SummaryBrowserPage.tsx now shows "Loading repository configuration..." until getInstanceCatalog() settles when no explicit ?branch= is present. Errors fall through to the legacy branch (good), but a stalled request leaves the browser unrendered indefinitely, whereas before this PR it rendered immediately. A short timeout or AbortSignal.timeout that falls back to legacy HEAD would preserve the old resilience. Not required — this only affects the hang case, not the error case.

S4: 🟢 Share the indexing deep-link builder across server and UI

packages/api/services/voiceBriefingService.ts, packages/api/services/webPushDispatcher.ts, and propr-ui/src/utils/summaryBrowser.ts each implement /summaries/:owner/:repo?branch= independently, and they already differ slightly (voice briefing routes the branch through safePathSegment, so a whitespace-only target.branch becomes ?branch=unknown while web-push and Inbox emit no query). A helper in @propr/shared would keep the three in lockstep as the route evolves. Cosmetic divergence today; not a blocker.

S5: 🟢 Simplify resolveSummaryBranch(undefined, branch) in SummaryBrowser

propr-ui/src/components/SummaryBrowser/index.tsx calls resolveSummaryBranch(undefined, branch), which is just normalizeSummaryBranch(branch). Using the simpler helper directly would make the intent (trim/empty → legacy) clearer to readers. Purely readability.

S6: 🟢 Guard the expanded-child write only via generation

The prev[entry.path]?.loading ? … : {} guards in toggleDirectory are redundant with the requestGenerationRef check immediately above (state is cleared in the same effect that bumps the generation) and quietly change semantics for a collapse-during-load race depending on how the collapse branch treats loading. Either drop the extra condition or add a test pinning the intended collapse-during-load behaviour. Optional; current behaviour is not incorrect.

Score

The changed code is correct and well tested against the objective and the previously reported gaps, but a failing current-head check (Validate Changes) that cannot be traced from the diff prevents calling it merge-ready.

Score: 7/10


🤖 Review Details

  • Model: Claude Fable 5.1
  • Time: 2m 13s
  • Tokens: 64,307 (53,767 in / 10,540 out)
  • Cost: $1.20

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Code Review — codex

Overall Evaluation

The PR substantially completes branch propagation and browser-state isolation, but needs a localized correction before merge. The current Validate Changes check also fails; the supplied evidence does not establish its cause.

✅ Consistent API propagation — Status, directory, path-summary, and recursive tree requests receive URL-encoded branch parameters.

✅ Scope isolation — Repository/branch changes clear browser state, and generation checks reject stale root and expanded-child responses.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Preserve branch identity in voice links

  • Required behavior: Indexing-notification voice links must preserve the target branch exactly.
  • Evidence: packages/api/services/voiceBriefingService.ts:432 — The new branch query uses safePathSegment(target.branch). That helper invokes boundedText, which replaces Unicode whitespace with ordinary spaces. For example, a valid Git branch containing internal U+00A0 (feature/a\u00A0b, in JavaScript notation) becomes feature/a b; the resulting link requests a different branch. Inbox and push encoding preserve that internal character.
  • Minimum fix: Encode target.branch directly with encodeURIComponent, matching the push implementation, and add a regression covering internal Unicode whitespace.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Exercise recursive branch propagation

The new getFullTree test uses maxDepth = 0 and an empty response, so it checks only the root request. A nested-directory fixture would protect branch propagation through recursive calls. This is optional because the implementation visibly forwards the branch correctly.

Score

The implementation and focused regressions address most of the objective, but voice links still alter some branch names. That localized correctness issue and the current failed validation check prevent merge readiness.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 2m 24s
  • Tokens: 50,330 (45,782 in / 4,548 out)
  • Cost: $0.69

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@integry

integry commented Sep 16, 2026

Copy link
Copy Markdown
Owner

/fix

@propr-dev

propr-dev Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ Applied the requested follow-up changes in commit 476f0e6

Addressed 1 AI review comment (IDs: 5694975925)

Summary of Changes

F1 is applied and verified. The fix is a backend link-encoding change, so it isn't visually perceptible and no preview files were created. Per the instructions, I did not commit — changes are left in the working tree.

What changed:

  1. packages/api/services/voiceBriefingService.ts:432 — the indexing-notification voice link now builds the branch query with encodeURIComponent(target.branch) instead of safePathSegment(target.branch). The old helper routed the branch through boundedText, which collapses Unicode whitespace (e.g. internal U+00A0) into ordinary spaces, so the link pointed at a different branch. The new call matches the push implementation in webPushDispatcher.ts:278 exactly.

  2. packages/api/test/voiceBriefingService.test.ts — added a regression test that feeds an indexing notification with branch feature/a\u00a0b (internal no-break space, written as an explicit escape so it's visible to reviewers) and asserts the resulting href is /summaries/integry/propr?branch=feature%2Fa%C2%A0b, preserving the character.

Verification: all 10 tests in voiceBriefingService.test.ts pass (including the new one), tsc --noEmit for @propr/api is clean, eslint on both changed files reports nothing, and git diff --check passes.

Nothing beyond F1 was touched — the inbox and push paths already encoded correctly and were left as-is.


🤖 Implementation Details

  • Model: Claude Fable 5 (high)
  • Requested By: @integry
  • Time: 3m 50s
  • Tokens: 661,049 (653,553 in / 7,496 out)
  • Cost: $1.41

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Implement fixes for issues found by /review /fix or /fix address the null check issue
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 5695369821✓

…ing change, so it isn't visually perceptible and no preview files were created. Per the instructions, I did not commit — changes are left in the working tree.

F1 is applied and verified. The fix is a backend link-encoding change, so it isn't visually perceptible and no preview files were created. Per the instructions, I did not commit — changes are left in the working tree.

**What changed:**

1. `packages/api/services/voiceBriefingService.ts:432` — the indexing-notification voice link now builds the branch query with `encodeURIComponent(target.branch)` instead of `safePathSegment(target.branch)`. The old helper routed the branch through `boundedText`, which collapses Unicode whitespace (e.g. internal U+00A0) into ordinary spaces, so the link pointed at a different branch. The new call matches the push implementation in `webPushDispatcher.ts:278` exactly.

2. `packages/api/test/voiceBriefingService.test.ts` — added a regression test that feeds an indexing notification with branch `feature/a\u00a0b` (internal no-break space, written as an explicit escape so it's visible to reviewers) and asserts the resulting href is `/summaries/integry/propr?branch=feature%2Fa%C2%A0b`, preserving the character.

**Verification:** all 10 tests in `voiceBriefingService.test.ts` pass (including the new one), `tsc --noEmit` for `@propr/api` is clean, eslint on both changed files reports nothing, and `git diff --check` passes.

Nothing beyond F1 was touched — the inbox and push paths already encoded correctly and were left as-is.

PR: integry#2348
Comment by: @integry (ID: 5695369821)
Model: claude-fable-5
@integry

integry commented Sep 16, 2026

Copy link
Copy Markdown
Owner

/review codex

@propr-dev

propr-dev Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Code Review — codex

Overall Evaluation

The PR substantially completes branch propagation and browser-state isolation, but needs minor changes because normalization can alter valid branch names. Current checks report 18 passed, six pending, seven neutral/skipped, and no failures.

✅ Consistent API propagation — Branch arguments reach status, directory, path-summary, and recursive tree requests.

✅ Scope isolation — Repository/branch changes clear cached state, while generation checks reject stale root and expanded-directory responses.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F2: 🔴 Preserve valid Unicode branch characters

  • Required behavior: Explicit and configured branches must retain their identity throughout browsing and navigation.
  • Evidence: propr-ui/src/utils/summaryBrowser.ts:5 — branch.trim() removes leading and trailing Unicode whitespace, including nonbreaking spaces that Git permits in branch names. For example, ?branch=feature%2Fa%C2%A0 resolves to feature/a instead of feature/a\u00a0. API requests and GitHub links consequently address a different branch.
  • Minimum fix: Preserve valid branch characters exactly. Restrict whitespace normalization to ASCII whitespace, which Git disallows in refs, and add a regression covering a trailing nonbreaking space through branch resolution and link generation.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Test branch-only scope changes

The new race tests change both repository owner and branch, and resolve the old status request before switching. Adding a same-repository branch switch and a genuinely late status response would independently protect those cases. The implementation already includes the relevant dependencies and guards, so these additional tests are optional.

Score

The implementation is focused and has useful regression coverage, but the branch-identity defect needs correction before merge. Pending checks alone do not cap the score.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 2m 55s
  • Tokens: 51,915 (46,329 in / 5,586 out)
  • Cost: $0.68

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@integry

integry commented Sep 16, 2026

Copy link
Copy Markdown
Owner

/fix

@propr-dev

propr-dev Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ Applied the requested follow-up changes in commit 1c60e6f

Addressed 1 AI review comment (IDs: 5695559759)

Summary of Changes

F2 is applied and verified. The fix restricts branch whitespace normalization in propr-ui/src/utils/summaryBrowser.ts to ASCII whitespace only, so valid Unicode branch characters like a trailing nonbreaking space now survive branch resolution, API queries, and link generation.

What changed:

  • normalizeSummaryBranch no longer uses String.prototype.trim() (which strips Unicode whitespace, including U+00A0). It now strips only the ASCII whitespace characters Git actually forbids in refs (space, tab, LF, CR, FF, VT) from the ends of the string, via a small ASCII_WHITESPACE_EDGES regex with a comment explaining the constraint. A branch like feature/a\u00a0 is preserved exactly, so ?branch=feature%2Fa%C2%A0 resolves to the real branch instead of feature/a.
  • Added the requested regression in propr-ui/src/utils/summaryBrowser.test.ts: a trailing nonbreaking space is preserved through resolveSummaryBranch (both explicit and configured branch paths, including mixed ASCII padding like '\tfeature/a\u00a0\n' normalizing to feature/a\u00a0) and through summaryBrowserPath link generation, which must emit %C2%A0 in the URL.

Verification: the summaryBrowser vitest file passes (4 tests, including the new regression), tsc --noEmit for propr-ui passes, and eslint on both changed files reports no issues. The remaining .trim() call sites in the repo touch other inputs (prompts, the repository-management baseBranch form) and are outside F2's scope, so I left them untouched.

This is a string-normalization fix with no visually perceptible effect, so no preview files were created. Per the instructions, I did not commit — the changes are left in the working tree.


🤖 Implementation Details

  • Model: Claude Fable 5 (high)
  • Requested By: @integry
  • Time: 3m 15s
  • Tokens: 364,521 (358,734 in / 5,787 out)
  • Cost: $0.86
  • Subscription usage: Session +2%

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Implement fixes for issues found by /review /fix or /fix address the null check issue
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 5695566443✓

…pace normalization in `propr-ui/src/utils/summaryBrowser.ts` to ASCII whitespace only, so valid Unicode branch characters like a trailing nonbreaking space now survive branch resolution, API queries, and link generation.

F2 is applied and verified. The fix restricts branch whitespace normalization in `propr-ui/src/utils/summaryBrowser.ts` to ASCII whitespace only, so valid Unicode branch characters like a trailing nonbreaking space now survive branch resolution, API queries, and link generation.

What changed:

- `normalizeSummaryBranch` no longer uses `String.prototype.trim()` (which strips Unicode whitespace, including U+00A0). It now strips only the ASCII whitespace characters Git actually forbids in refs (space, tab, LF, CR, FF, VT) from the ends of the string, via a small `ASCII_WHITESPACE_EDGES` regex with a comment explaining the constraint. A branch like `feature/a\u00a0` is preserved exactly, so `?branch=feature%2Fa%C2%A0` resolves to the real branch instead of `feature/a`.
- Added the requested regression in `propr-ui/src/utils/summaryBrowser.test.ts`: a trailing nonbreaking space is preserved through `resolveSummaryBranch` (both explicit and configured branch paths, including mixed ASCII padding like `'\tfeature/a\u00a0\n'` normalizing to `feature/a\u00a0`) and through `summaryBrowserPath` link generation, which must emit `%C2%A0` in the URL.

Verification: the summaryBrowser vitest file passes (4 tests, including the new regression), `tsc --noEmit` for propr-ui passes, and eslint on both changed files reports no issues. The remaining `.trim()` call sites in the repo touch other inputs (prompts, the repository-management baseBranch form) and are outside F2's scope, so I left them untouched.

This is a string-normalization fix with no visually perceptible effect, so no preview files were created. Per the instructions, I did not commit — the changes are left in the working tree.

PR: integry#2348
Comment by: @integry (ID: 5695566443)
Model: claude-fable-5
@integry

integry commented Sep 16, 2026

Copy link
Copy Markdown
Owner

/review codex

@propr-dev

propr-dev Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Code Review — codex

Overall Evaluation

The PR implements branch-aware browsing with focused API, navigation, and state-management changes. It needs minor changes before merge because explicit notification actions can still lose the indexed branch.

✅ Consistent API propagation — Status, directory, path-summary, and recursive tree requests carry the encoded branch.

✅ Scope isolation — Repository/branch changes clear browser state, and generation checks reject stale root and child responses.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F3: 🔴 Preserve branches in explicit Browse actions

  • Required behavior: Indexing-notification Browse links must preserve the notification’s branch.
  • Evidence: packages/api/services/webPushDispatcher.ts:278 adds the branch only to targetPath(). In the supplied buildSafePayload(), a navigate action overrides that fallback, and its URL also supplies the “View details” action. A notification targeting release/2026 with action /summaries/integry/propr therefore opens the configured branch instead. propr-ui/src/pages/inboxUtils.ts:58 likewise updates only the fallback; explicit actions retain precedence.
  • Minimum fix: When a navigate action points to the target repository’s summary page without a branch query, append the encoded target branch. Preserve existing explicit branch queries and other parameters. Apply this to Inbox links, push deep links, and push action URLs; cover the branchless-action case with a regression test.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Cover branch-only and late-status transitions

The scope tests change repository and branch together. Also, the test named “ignores late status and root responses” resolves the old status before switching, so it exercises only a late root response. A same-repository branch switch with an outstanding status request would strengthen coverage. This is optional because the implemented generation checks already appear to handle those transitions.

Score

The core browsing implementation is sound, but notification branch preservation remains incomplete for explicit Browse actions. The supplied current checks show no failures, with six pending.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 3m 8s
  • Tokens: 52,578 (46,565 in / 6,013 out)
  • Cost: $0.77

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@integry

integry commented Sep 16, 2026

Copy link
Copy Markdown
Owner

/fix

@propr-dev

propr-dev Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ Applied the requested follow-up changes in commit 3506700

Addressed 1 AI review comment (IDs: 5695730004)

Summary of Changes

F3 is applied and verified. Explicit Browse navigate actions on indexing notifications now carry the notification's branch instead of falling back to the configured branch.

What changed

  • propr-ui/src/utils/summaryBrowser.ts — added summaryHrefWithBranch(href, repository, branch): when an application-relative href points at the target repository's /summaries/:owner/:repo page and has no branch query, it appends the encoded branch. Explicit ?branch= queries, other query parameters, hashes, and unrelated links pass through unchanged.
  • propr-ui/src/pages/inboxUtils.ts — notificationHref now routes indexing-notification navigate actions through that helper, so Inbox links preserve the branch even when the server supplied a branchless action; previously the action href bypassed the branch entirely.
  • packages/api/services/webPushDispatcher.ts — added an equivalent navigateHrefWithTargetBranch helper and threaded the notification target into notificationActionUrl, so both the push deep link and the "View details" action URL append the target branch to branchless summary-page actions before resolving against the frontend URL (frontend base params such as tenant are still merged).

The finding's failure scenario — a notification targeting release/2026 with action /summaries/integry/propr — now opens ?branch=release%2F2026 in all three link kinds. Voice links were untouched, since they use only the fallback path F3 didn't flag.

Regression tests added

  • inboxUtils.test.ts: branchless action gains the branch; an explicit ?branch=feature%2Fui action wins over the target branch; a /repositories action is untouched.
  • summaryBrowser.test.ts: unit coverage of the helper, including other-parameter preservation and non-matching repositories.
  • webPushDispatcher.test.ts: an indexing event with a branchless navigate action produces a deep link and action URL with branch=release/2026 while keeping the tenant base param.

Verification — new dispatcher suite: 20/20 passed (SQLite-backed, ran fine in this container); full propr-ui vitest: 1090/1090 passed; tsc --noEmit and eslint clean for both packages on the changed files; git diff --check clean.

No preview files were created: the change only alters link query strings, so nothing is visually perceptible — matching the precedent set for F1. Changes are left uncommitted for the system to commit.


🤖 Implementation Details

  • Model: Claude Fable 5 (high)
  • Requested By: @integry
  • Time: 7m 48s
  • Tokens: 1,507,918 (1,482,637 in / 25,281 out)
  • Cost: $3.57

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Implement fixes for issues found by /review /fix or /fix address the null check issue
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 5695913077✓

…s on indexing notifications now carry the notification's branch instead of falling back to the configured branch.

F3 is applied and verified. Explicit Browse navigate actions on indexing notifications now carry the notification's branch instead of falling back to the configured branch.

**What changed**

- `propr-ui/src/utils/summaryBrowser.ts` — added `summaryHrefWithBranch(href, repository, branch)`: when an application-relative href points at the target repository's `/summaries/:owner/:repo` page and has no `branch` query, it appends the encoded branch. Explicit `?branch=` queries, other query parameters, hashes, and unrelated links pass through unchanged.
- `propr-ui/src/pages/inboxUtils.ts` — `notificationHref` now routes indexing-notification navigate actions through that helper, so Inbox links preserve the branch even when the server supplied a branchless action; previously the action href bypassed the branch entirely.
- `packages/api/services/webPushDispatcher.ts` — added an equivalent `navigateHrefWithTargetBranch` helper and threaded the notification target into `notificationActionUrl`, so both the push deep link and the "View details" action URL append the target branch to branchless summary-page actions before resolving against the frontend URL (frontend base params such as `tenant` are still merged).

The finding's failure scenario — a notification targeting `release/2026` with action `/summaries/integry/propr` — now opens `?branch=release%2F2026` in all three link kinds. Voice links were untouched, since they use only the fallback path F3 didn't flag.

**Regression tests added**

- `inboxUtils.test.ts`: branchless action gains the branch; an explicit `?branch=feature%2Fui` action wins over the target branch; a `/repositories` action is untouched.
- `summaryBrowser.test.ts`: unit coverage of the helper, including other-parameter preservation and non-matching repositories.
- `webPushDispatcher.test.ts`: an indexing event with a branchless navigate action produces a deep link and action URL with `branch=release/2026` while keeping the `tenant` base param.

**Verification** — new dispatcher suite: 20/20 passed (SQLite-backed, ran fine in this container); full propr-ui vitest: 1090/1090 passed; `tsc --noEmit` and eslint clean for both packages on the changed files; `git diff --check` clean.

No preview files were created: the change only alters link query strings, so nothing is visually perceptible — matching the precedent set for F1. Changes are left uncommitted for the system to commit.

PR: integry#2348
Comment by: @integry (ID: 5695913077)
Model: claude-fable-5
@integry

integry commented Sep 16, 2026

Copy link
Copy Markdown
Owner

/review codex

@propr-dev

propr-dev Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

🔍 AI Code Review — codex

Overall Evaluation

The PR consistently carries branch identity through browsing, summary requests, notification links, and GitHub links. It is ready to merge within scope, conditional on the remaining checks passing.

✅ Branch precedence — Standalone browsing resolves explicit branches before configured branches and preserves the legacy fallback when neither resolves.

✅ Scope isolation — Repository and branch changes reset browser state; generation checks reject stale root and expanded-directory responses.

✅ Branch propagation — All four summary API helpers forward encoded branches, including recursive tree requests. Inbox and web-push actions preserve existing explicit branch queries.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Test branch-only scope changes

The scope-isolation tests change both repository and branch together. Add a case that changes only the branch and resolves the previous branch’s status afterward. This would protect the branch dependency and stale-status guard independently; the current implementation already includes both protections, so this is optional.

S2: 🟢 Exercise recursive branch propagation

The getFullTree test uses depth zero with an empty response, so it verifies only the root request. A directory fixture with a child request would protect recursive branch forwarding. The implementation already forwards the branch at every level, making this additional coverage optional.

Score

The implementation addresses the objective with focused regression coverage and no verified merge blockers. Current checks report 13 passed, 10 pending, 7 neutral/skipped, and no failures.

Score: 9/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 2m 5s
  • Tokens: 52,758 (48,824 in / 3,934 out)
  • Cost: $0.58

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@integry
integry merged commit 2f5ed62 into integry:main Sep 16, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants