Skip to content

fix(tui): resolve links while session location loads - #1

Closed
andy-takker wants to merge 1 commit into
YidaWeng:local-file-linksfrom
andy-takker:file-link-regression
Closed

andy-takker wants to merge 1 commit into
YidaWeng:local-file-linksfrom
andy-takker:file-link-regression

Conversation

@andy-takker

Copy link
Copy Markdown

Issue for this PR

Follow-up to anomalyco#55769; fixes anomalyco#54816 together with the parent PR. This targets your local-file-links branch and preserves your existing commits.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

While Location metadata is loading, the transcript can already be clicked. Relative links then fall back to the launch directory, even though the session's directory is available in location.ref.

Use that reference before falling back to cwd. Add full-app tests clicking [Скачать обновлённую картинку](artifacts/lms-roadmap.png) with loaded and pending metadata. They exercise the real renderer and opening path, intercepting only the final OS launcher, and check exactly-once default-handler dispatch plus HTTPS.

How did you verify your code works?

  • Reproduced the wrong-directory failure before the fix. Restoring the original HTTP-only handler also fails both regression cases.
  • 30 focused test repetitions, all 143 util tests, package typechecks, and root bun run check pass on macOS with Bun 1.4.4.
  • Full TUI suite: 1,552 pass, two skip, one existing go-upsell-art failure, independently reproduced with the parent PR's production source. Root check has existing warnings.
  • Merged unchanged into upstream dev 97a71f0cc624f128906224ca73d9e4016b43fde0 in a separate checkout: no conflicts, 13 targeted tests and root check pass.
  • Native Warp/Ghostty smoke is unverified: automation failed macOS Accessibility window access. No actual viewer launch is claimed. Windows/Linux execution has not been performed locally.

Visual

<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72">
  <g fill="none" stroke="currentColor" stroke-width="2">
    <rect x="8" y="18" width="76" height="36" rx="4" opacity=".5"/>
    <path d="M20 36h50M96 36h38m-7-6 7 6-7 6"/>
    <rect x="148" y="10" width="84" height="52" rx="4"/>
    <path d="m157 52 20-21 13 14 12-9 20 16"/>
    <circle cx="211" cy="23" r="4"/>
    <circle cx="95" cy="36" r="3" fill="currentColor" stroke="none">
      <animate attributeName="cx" values="95;134;134;95" keyTimes="0;.45;.8;1" dur="2s" repeatCount="indefinite"/>
      <animate attributeName="opacity" values="0;1;0;0" keyTimes="0;.3;.7;1" dur="2s" repeatCount="indefinite"/>
    </circle>
  </g>
</svg>

Screenshots / recordings

No native capture: blocked by macOS Accessibility access. The change does not alter layout.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@YidaWeng

Copy link
Copy Markdown
Owner

Thanks — the diagnosis is right, and this is now in local-file-links.

I cherry-picked 886e445eb (authorship preserved) into the branch behind anomalyco#55769 rather than merging the PR, so the upstream history stays linear. Then I merged current dev (d5ea1ee67) and pushed c4cd2040c.

One addition: I extended the launcher assertion for WSL. On WSL, open goes through PowerShell and converts the target with wslpath -aw, so the test now asserts that form instead of expecting xdg-open. With that, both cases pass locally: --rerun-each 5 is 10/10, test/ui/link.test.tsx is 2/2, src/open.test.ts is 11/11, and root bun run check is 35/35.

The fork's build, unit, and affected packages jobs target Blacksmith runners that only exist in the upstream org, so they queue and get cancelled after 24 hours here. That is not a failure from this change; the upstream checks on anomalyco#55769 will run on the updated branch. Closing this in favor of the upstream PR.

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.

2 participants