Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

annotate shows the launch directory's repo, not the file's

Open Beginner friendly
#2,290 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
git, typescript
Domain
cli

Research direction

Read packages/server/repo.ts to see how getRepoInfo() falls back to process.cwd(), then inspect its call sites in packages/server/annotate.ts and apps/pi-extension/server/serverAnnotate.ts. Pass the target path: the file's directory for one file, the folder for a folder, and the bundle's common root for several files; keep the launch directory for URLs and annotate-last. Add a test where the target sits outside the launch directory's repo, and confirm the repo chip, branch chip, and tab suffix show the target's repo.

Written by the indexing model from the issue text.

Description

plannotator annotate takes the repo and branch it shows from the directory the command runs
in, not from the repo that holds the file. When an agent launches a review from a different
directory than the document's, the repo chip, the branch chip and the tab title's repo suffix
(#2061) all name the wrong repository.

Repro

Two repos, one nested in the other (a docs repo holding a code checkout, git-ignored):

~/work/payments-docs/          # repo acme/payments-docs, branch main
~/work/payments-docs/payments/ # repo acme/payments, branch feat/refunds
cd ~/work/payments-docs/payments
plannotator annotate ../specs/refunds.md
  • Expected: acme/payments-docs and main, the repo and branch of refunds.md.
  • Actual: acme/payments and feat/refunds. The tab reads refunds.md · acme/payments.

Nesting isn't required. Any launch from outside the file's repo shows the launch directory's repo,
and a file outside any repo gets the launch directory's repo too.

Cause

packages/server/annotate.ts calls getRepoInfo() with no argument, so it falls back to
process.cwd() (packages/server/repo.ts). The Pi extension does the same in
apps/pi-extension/server/serverAnnotate.ts. Code review already passes its git context's
cwd, so it isn't affected.

Suggestion

Resolve the repo from the target when there is one on disk:

  • One file: the file's directory.
  • A folder: the folder.
  • Several files: the common root the bundle already computes.
  • A URL or annotate-last: keep the launch directory, as today.

The change is one argument at each call site, plus a test with the target outside the launch
directory's repo. Happy to send the PR.

Dominant language
TypeScript
Stars
8.7k
Forks
649
Avg merge
11h 48m
Merged PRs (30d)
552

Getting set up

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.

More from backnotprop/plannotator

All issues in backnotprop/plannotator

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.