Inbox: several Linear keys, one per workspace, picked by the link's workspace

Open
#3,939 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
46/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
api, backend, frontend

Research direction

Start from the current single-key path: the handler behind POST /api/inbox/linear/key, the reading of inbox/linear-key / LINEAR_API_KEY, and the hover-card lookup that resolves a linear.app/<workspace>/issue/... link. /api/inbox/linear-refs already returns each key's workspace, so trace how that response feeds the Settings, Accounts, Linear row before adding the list UI. Done means inbox/linear-keys.json (0600) is the store with the old key read as one entry, both request shapes work on the existing endpoint, and cards resolve per workspace slug while unknown workspaces stay plain links. This spans storage, API and settings UI, so read the surrounding Inbox code before editing.

Written by the indexing model from the issue text.

Description

Problem

The Inbox takes one Linear API key (Settings, Accounts, Linear; saved in inbox/linear-key, or LINEAR_API_KEY). A Linear personal API key belongs to one workspace, so links to issues in any other workspace get no hover card. #3146 lists this as a known limit: "A link to another workspace's issue gets no card."

People who work in two Linear workspaces (for example a day job and a side project) see cards for one and plain links for the other. The only workaround today is to swap the saved key through POST /api/inbox/linear/key whenever they switch context, which also drops the cards for the workspace they just left.

Request

Let the Inbox hold several Linear keys and pick one per link by the workspace slug in the URL (https://linear.app/<workspace>/issue/ENG-123/...).

  • Settings, Accounts, Linear: a list of keys instead of one. When a key is saved, the server already learns its workspace (/api/inbox/linear-refs returns workspace), so each row can show the workspace name and the key's last 4 characters, with Remove per row.
  • Cards: for a link to linear.app/<workspace>/..., use the key whose workspace is <workspace>. A link to a workspace with no key stays a plain link, as now.
  • Storage: for example inbox/linear-keys.json ({ "<workspace>": "<key>" }, mode 0600), with today's inbox/linear-key read as one entry so existing setups keep working. An env form could be LINEAR_API_KEYS=<workspace>=<key>,<workspace>=<key> next to LINEAR_API_KEY.
  • API: POST /api/inbox/linear/key could take { key } to add or replace the entry for that key's workspace, and { workspace, key: null } to remove one, so scripts that set keys today keep working.
  • The issue-ref teams (/api/inbox/linear-refs) would then cover every workspace with a key.

The same lookup would help plan review and annotate, which got Linear cards in #3783.

Related

  • #3120: hover cards for Linear issue links.
  • #3146: Linear hover cards and the Linear key in Settings, Accounts.
  • #3783: Linear cards in plan review and annotate.

Setup

Plannotator 0.29.2, Linux (Ubuntu), Inbox reached over Tailscale.

Dominant language
TypeScript
Stars
8.7k
Forks
649
Avg merge
16h 1m
Merged PRs (30d)
756

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.