jcfischer / jcfischer/supertag-cli

Extract formatNodeRef helper in webhook semantic/FTS renderers

Open Beginner friendly
#94 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
49
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Non-blocking maintainability nit from sage review of #93.

src/server/tana-webhook-server.ts repeats the same node-reference shape in three spots (semantic node, semantic ancestor, FTS):

if (name.includes("[[") && name.includes("]]")) {
  const match = name.match(/\[\[.+?\]\]/);
  ref = match ? match[0] : name.trim();
} else {
  ref = `[[${name}^${id}]]`;
}

Extract a local formatNodeRef(name: string, id: string): string and call it for node, ancestor, and the FTS renderer. Keeps the three branches from drifting. Also include the || "(unnamed)" null-coalesce inside the helper so the guard lives in one place.

Filed from #93 review, 2026-06-12.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/server/tana-webhook-server.ts and inspect the semantic node, semantic ancestor, and FTS renderer branches that build node references. Extract the shared formatting behavior, including the unnamed fallback, and verify that all three renderers retain their existing output without drifting.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, search
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.