You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf: index graph parents and successors for reply paths - #1417
Building reply paths repeatedly searches every measured graph node for a parent’s replies and continuation. This groups those relationships once, so each lookup scans the matching nodes in their original order.
All 33 graph-edge tests passed, along with TypeScript checks and the build. I also compared complete edge results with the original implementation for small graphs, many unrelated threads, and a large sibling group, including drawing-state variants. The results matched.
This removes scans of unrelated nodes. A single large sibling group can still require quadratic filtering; the PR does not claim linear behavior or a measured browser rendering improvement. GitHub’s test workflow is awaiting repository approval.
Summary by CodeRabbit
Bug Fixes
Improved consistency of thread branch connections when a thread is displayed alongside many unrelated nodes.
Tests
Added coverage to verify that reply and continuation connections remain consistent as unrelated nodes are added.
Review was skipped as selected files did not have any reviewable changes.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 36c7af06-4641-488c-aa11-c7d59a4b16a0
Commits
Reviewing files that changed from the base of the PR and between a72afa3 and 148b293.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
graphEdges groups nodes by parent and predecessor before building branch edges. The branch logic uses these groups to find successors and earlier replies. A regression test checks that adding 200 unrelated nodes does not change the thread’s reply and continuation edge IDs or paths.
graphEdges groups nodes by parent and predecessor, then uses those groups to find branch successors and earlier replies. A regression test checks edge IDs and paths with 200 unrelated nodes added.
line thread of commit not showing after third reply #1453: The issue reports a missing reply thread line. This PR changes the parent and successor lookups used for reply paths, but the available information does not show that it fixes the reported issue.
Possibly related PRs
dev-null-sh/dev-null.sh#1226: This PR also changes graphEdges branch-edge lookup by indexing continuation and sibling relationships.
Suggested reviewers:jubianchi
Merge Risk: Minimal · previous review a72af
No concrete correctness or availability risk is established by this change.
Architecture risk: Low · up to a72af
The change affects 2 systems.
Changed systems:resources, tests
Architecture concerns
No architecture-level concerns identified.
Review details
Systems and components
observed — resources (service) was modified; 1 changed file maps to changed impact.
observed — tests (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
observed — Modified behavior in resources/js/lib/graph.ts: graphEdges now builds maps of nodes keyed by parent and predecessor (after) before creating edges, replacing the prior edge-array initialization at this point.
observed — Modified behavior in resources/js/lib/graph.ts: The branch logic now checks only the parent’s grouped successors for a lower, non-drawing trunk, and selects earlier replies from its grouped replies. These replace scans across all nodes; the filtering conditions are unchanged.
observed — Modified behavior in tests/Unit/GraphEdges.test.ts: Adds a regression test that compares the thread’s edge IDs and paths with and without 200 unrelated nodes; it expects the results to be identical.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: indexing graph parents and successors to improve reply-path performance.
Docstring Coverage
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 256e64f2-0601-40c3-b8bc-7470d5c9da52
Commits
Reviewing files that changed from the base of the PR and between 2c15b1d and a72afa3.
Files selected for processing: 1
tests/Unit/GraphEdges.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Building reply paths repeatedly searches every measured graph node for a parent’s replies and continuation. This groups those relationships once, so each lookup scans the matching nodes in their original order.
All 33 graph-edge tests passed, along with TypeScript checks and the build. I also compared complete edge results with the original implementation for small graphs, many unrelated threads, and a large sibling group, including drawing-state variants. The results matched.
This removes scans of unrelated nodes. A single large sibling group can still require quadratic filtering; the PR does not claim linear behavior or a measured browser rendering improvement. GitHub’s test workflow is awaiting repository approval.
Summary by CodeRabbit