Skip to content

@whybebabo/dsh-code-nav v0.1.1

Choose a tag to compare

@whybebabo whybebabo released this 08 Oct 09:08
· 15 commits to main since this release

@whybebabo/dsh-code-nav v0.1.1

Fork of AnakinCao/dsh-code-nav at commit 0d34d27.
Published to npm as @whybebabo/dsh-code-nav@0.1.1.

dsh plugin --profile desktop add @whybebabo/dsh-code-nav

Added

  • Selection → add to conversation — selecting code in the preview floats
    the same "Add to conversation" button the better-sidebar built-in viewers
    show, inserting the selection into the session composer as a fenced block
    headed by relative/path:start[-end] (the built-in payload shape; over 500
    characters inserts the path line only).

    Taking the preview over used to lose this affordance entirely: the plugin
    registers with priority: 10, so the built-in TextEditor never mounts,
    and the popup lives inside TextEditor only — the betterSidebar service
    exposes no selection, popup or draft API.

Notes

  • Line numbers come from the rendered line containers and the text from the
    per-line code column, so the user-select: none gutter never leaks into the
    payload; a selection ending exactly at the next line start narrows the span.
  • The insert prefers the official captureInsertion() / insertText() (one
    undo step, reference chips preserved, refuses without touching the draft
    while the composer is busy) and falls back to setDraft on older hosts.
  • Dismissal follows better-sidebar's contract: outside mousedown, Escape,
    hidden document, blur, scroll, surface leaving the viewport.
  • The registration id in lib/client.js is now injected from package.json by
    scripts/build.mjs — client-modules keys its module table by the full package
    name, so the scoped rename required it.
  • ⚠️ Do not install alongside the upstream dsh-code-nav: both register the
    viewer id dsh-code-nav:outline.

The upstream change is open as AnakinCao/dsh-code-nav#1;
if it merges and upstream publishes, prefer the upstream package.