jcfischer / jcfischer/supertag-cli
Extract formatNodeRef helper in webhook semantic/FTS renderers
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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