Skip to content

feat(serve): artifact view source link opens the /source viewer at the artifact line (REQ-243, #623)#653

Merged
avrabe merged 1 commit into
mainfrom
feat/req-243-source-open
Jul 2, 2026
Merged

feat(serve): artifact view source link opens the /source viewer at the artifact line (REQ-243, #623)#653
avrabe merged 1 commit into
mainfrom
feat/req-243-source-open

Conversation

@avrabe

@avrabe avrabe commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements REQ-243 (#623): the rivet serve artifact detail view's source link now deep-links into the built-in /source viewer at the artifact's definition line. Previously it was a dead href="#" that did nothing in a plain browser — the open-at-location behavior only existed in the VSIX extension.

Two runtimes, one anchor

  • Browser dashboard (htmx loaded): the link uses hx-get="/source/{path}" + hx-target="#content" + hx-push-url, and an onclick scrolls to the artifact's line.
  • VSIX webview (no htmx): the existing shell.ts shim intercepts the data-source-file / data-source-line attributes and opens the file in the editor.

The VSIX webview loads no htmx, so the two paths never collide — verified by inspecting vscode-rivet/src/shell.ts (only mermaid + the inline shim are loaded).

Off-by-one (deliberate)

The /source viewer numbers rows 1-based, so the browser scroll target is source_line + 1. data-source-line stays 0-based for the VSIX host, which consumes it as a 0-based vscode.Position.

Verification

  • New serve_integration test artifact_detail_source_link_opens_source_view asserts the detail HTML carries hx-get="/source/, href="/source/, data-source-file=, data-source-line=, and the scroll target.
  • Live server check: /artifacts/REQ-001 emits the deep-link; GET /source/<encoded path> returns 200; scroll target lands on the artifact's line.
  • Full serve_integration suite 47/47; cargo clippy --all-targets -- -D warnings exit 0; cargo fmt --check clean; rivet validate PASS.

Traceability

  • Implements / Verifies: REQ-243 (status → verified)
  • Refs: FEAT-001

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

📐 Rivet artifact delta

Change Count
Added 0
Removed 0
Modified 1
Downstream impacted (depth ≤ 5) 0

Graph

graph LR
  REQ_243["REQ-243"]:::modified
  classDef added fill:#d4edda,stroke:#28a745,color:#155724
  classDef removed fill:#f8d7da,stroke:#dc3545,color:#721c24
  classDef modified fill:#fff3cd,stroke:#ffc107,color:#856404
  classDef overflow fill:#e2e3e5,stroke:#6c757d,color:#495057,stroke-dasharray: 3 3
Loading
Modified
ID Changes
REQ-243

📎 Full HTML dashboard attached as workflow artifact rivet-delta-pr-653download from the workflow run.

Posted by rivet-delta workflow. The graph shows only changed artifacts; open the HTML dashboard (above) for full context.

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…e artifact line (REQ-243, #623)

The artifact detail view showed the source file but the link was a dead
`href="#"` that did nothing in a plain browser — it only worked via the
VSIX editor shim. It now deep-links into the built-in `/source` viewer at
the artifact's definition line (hx-get + hx-push-url, scrolling to the
line), while keeping the `data-source-file`/`data-source-line` attributes
so the VSIX webview shim still opens the file in the editor. The VSIX
webview loads no htmx, so the two runtimes don't collide: browser follows
hx-get, VSIX follows the shim.

The header file link uses a distinct `source-file-link` class (not the
`source-ref-link` used by inline cited-source refs) so selectors that pick
the first inline source ref on the detail page keep working — the
Playwright aadl.spec.ts test asserts the first `a.source-ref-link` is an
`.aadl` ref.

Off-by-one: the `/source` viewer numbers rows 1-based, so the browser
scroll target is `source_line + 1`; `data-source-line` stays 0-based for
the VSIX host, which consumes it as a 0-based position.

Confirmed with a live server (deep-link present, /source returns 200 for
REQ-001, scroll lands on the artifact line), the full serve_integration
suite (47/47), cargo clippy --all-targets -- -D warnings, and cargo fmt
--check — all green.

Implements: REQ-243
Verifies: REQ-243
Refs: FEAT-001
@avrabe avrabe force-pushed the feat/req-243-source-open branch from f7a44a7 to 3ecc188 Compare July 2, 2026 05:46

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Rivet Criterion Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 3ecc188 Previous: cdeb7f8 Ratio
store_insert/10000 19780009 ns/iter (± 1960487) 16453856 ns/iter (± 1176580) 1.20

This comment was automatically generated by workflow using github-action-benchmark.

@avrabe avrabe merged commit ce754d3 into main Jul 2, 2026
26 of 27 checks passed
@avrabe avrabe deleted the feat/req-243-source-open branch July 2, 2026 06:02
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