annotate shows the launch directory's repo, not the file's
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-docsandmain, the repo and branch ofrefunds.md. - Actual:
acme/paymentsandfeat/refunds. The tab readsrefunds.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
- 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.
More from backnotprop/plannotator
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
backnotprop/plannotator#2317 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
backnotprop/plannotator#2306 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
backnotprop/plannotator#2243 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Annotate documentation omits per-file version history and privacy controlsMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
backnotprop/plannotator#1086 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 53/100
backnotprop/plannotator#2305 ·
Maintainers usually reply within 1 day
All issues in backnotprop/plannotator
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
marmelab/react-admin#11431 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
db-ux-design-system/core-web#8655 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
stripe/react-stripe-js#728 ·
-
[Upload Grade C dataset] the pop-up changes it's size while uploading the document => Jumping effectOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
epam/statgpt-admin-frontend#305 ·
Maintainers usually reply within 1 day