Repository navigation
Conversation
…hain Refs: AI-189 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Refs: AI-189 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…daptive Refs: AI-189 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Use graphlib.TopologicalSorter for the longest-chain calculation, drop the statement-keyword list the connector check already covers, share the setting defaults through module constants, and parametrize the direction tests. Refs: AI-189 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
PR Summary by QodoAdaptive Mermaid PR-changes diagram direction with configurable threshold
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1. Single-quoted strings in tests
|
Read the direction settings from Dynaconf only, so configuration.toml stays the single source of the defaults. Treat an unrecognised direction as adaptive and log it, matching the docstring. Detect two-character connectors as middle-label openers so an unquoted edge label no longer counts as a node in the chain. Refs: AI-189 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Thanks — all three applied in Duplicated defaults. The Python constants are gone. Invalid direction. Fixed, though as a fallback rather than a no-op: an unrecognised value now logs a debug line and uses Unquoted edge labels. Good catch — this was a real mis-parse. A two-character connector ( |
A misconfigured pr_diagram_direction falls back to adaptive; log it loudly enough to be noticed rather than silently. Refs: AI-189 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
On the remaining "invalid direction still rewrites" finding — the defect was real but it was in the docstring, which promised no change while the code fell back to The fair half of the objection was "silently", so in Happy to switch to a strict no-op if a maintainer prefers that — it's a one-line change either way. |
|
Code review by qodo was updated up to the latest commit 030602f |
|
Hey @IsmaelMartinez, |
Picks the
/describechanges-diagram direction from the shape of the graph instead ofhard-coding
LR. A diagram whose longest chain exceedspr_description.pr_diagram_direction_threshold(default 5) is drawn top-down, so wide diagramsstop being scaled down until unreadable on GitLab.
pr_description.pr_diagram_directionpins itto
LRorTDinstead.Deterministic post-processing next to
sanitize_diagram()— no prompt or token-cost change. Anyparse failure, cycle or non-flowchart diagram is returned untouched.
One open question: I've defaulted to
adaptive. The conservative choice isLR, which preservestoday's behaviour exactly and makes this opt-in. I leaned the other way because GitLab has no
expand control on a rendered diagram — once it's scaled down there's no way to see it, so the
status quo fails silently for the people it affects most. Happy to flip the default if you'd
rather ship it opt-in.
Closes #2597