# Lineardr A native Herdr panel for managing your assigned Linear issues without leaving the app. It lists issues, opens details and comments, creates and edits issues, and offers an optional **Agent** action through an existing Herdr dialog. The picture is a capture of the panel with **fictional issue data substituted for private content**. ![Lineardr panel with fictional sample issues](preview.png) ## What you see - A theme-colored, rounded panel with a subtle border; the standalone overlay defaults to **640 × 760 px**. Nothing is added to the layout on installation (`place: "none"`). It can instead be placed as a block in a person's own right-side panel. - A **42 px header**: “◉ Lineardr”, the assigned-issue count, **+ New** and **Refresh**; on a detail/edit screen it offers **← Back** and, for details, **Edit**. - Below it, **All / Todo / In progress / Backlog** filter chips and an ID-or-title search input. The scrollable list uses two-line rows: blue identifier, truncated title and a small **Agent** button; below, a colored workflow dot, state/priority/team and assignee. Text is about 11–13 px with muted secondary metadata. - Opening a row shows its identifier, title, state, priority, assignee, label chips, Markdown description, Markdown comments and a multi-line comment field. Creating/editing shows a title input, multi-line Markdown description, team/status/priority/assignee choices and a save button. Loading and error messages appear above the content. - Colors come from `theme()` rather than fixed hex values. There are no Herdr agent-status badges (working/blocked/done/idle) in this panel; the colored dots are **Linear workflow states**. ## How it behaves - Reads the authenticated user's assigned issues (not all workspace issues), newest-updated first; refreshes on demand and every **60 seconds** while on the list. Filters/search are local. A missing key or API failure produces a visible error rather than a blank list. - Clicking an issue loads its details and comments. **+ New** creates an issue in a selected team; **Edit** saves only changed title, description, state, assignee and priority fields. Posting a nonempty comment reloads details. Back returns to the list from details, or to details from editing; Herdr closes the overlay with Escape or `mod.open` again. - **Agent** stops the row click and opens the *separately installed* `linear-agent` dialog. It passes identifier, title, description, URL and Linear branch suggestion, plus repository choices from the active space, other Herdr spaces and optional team-to-repository mappings. It does **not** start an agent on click: the person selects repository, branch, agent/model and instructions, then explicitly confirms **Start agent** in that dialog. - There is **no mandatory key binding** and no `keys.json` snippet for this mod. A person can run `herdr-app do mod.open --name lineardr` or add a block to their own layout. ## Built from - **One distributable mod:** `mods/lineardr/main.js` default-exports a `gpui-kit` `View`; `mod.json` specifies `place: "none"` and a 640 × 760 overlay. `gpui-base` provides input and textarea state and Markdown `TextView`. Source lives in TypeScript (`src/main.ts`, `src/linear.ts`, `src/agent-target.ts`, `src/utf8-shim.ts`); esbuild bundles Effect 3 into Herdr-compatible JavaScript, leaving `herdr`, `gpui-kit` and `gpui-base` external. An alternative implementation may use equivalent typed failures and response parsing if Effect cannot run in the target Herdr version. - **Linear GraphQL:** `fetch` POSTs variable-based queries/mutations to `https://api.linear.app/graphql`. Read `viewer.assignedIssues(first: 50, after: ...)` and lightweight `teams(first: 50, after: ...)` in separate requests; load a selected team's states/members on demand and `issue(id)` with paginated comments. Mutate with `issueCreate`, `issueUpdate` and `commentCreate`. Parse GraphQL envelopes, HTTP/GraphQL errors and response shapes; check mutation `success`. Bound pagination (1,000 issues, 500 comments). `Effect` represents network/parse failures; `Redacted` wraps the key. - **Credentials:** `readTextFile` checks `appHome()/lineardr.json`, falling back to `appHome()/linear.json`, for `{ "apiKey": "..." }`. The person obtains their own Linear **personal API key**, stored locally outside the mod with mode `0600`. Personal keys use the raw `Authorization: ` header (OAuth is not implemented). Optional `repos: { "TEAM": "~/repo" }` and `repoChoices: ["~/other-repo"]` inform the Agent dialog. Do not ship a key. - **Herdr APIs:** `theme`, `spaces`, `panes`, `focused`, `home`, `appHome`, `readTextFile` and `openOverlay`. `cx.spawn` owns async requests; `cx.timer.every(60000, ...)` drives refresh; `cx.notify` updates the view. The panel itself runs **no** `exec` or `hc` commands. The optional, **not bundled**, `linear-agent` dialog may run Git commands and launch an agent/worktree only after the person confirms. ## Watch out - **Disclose before installation:** the mod sends requests to Linear and reads local credential/repository configuration outside its own folder. The optional Agent action delegates to another mod that can run programs. Existing mod names and key bindings must be preserved; customize an available name instead of overwriting one. - **Keep GraphQL queries small:** asking for issues and every team's members/states together produced Linear's “Query too complex” HTTP 400. Paginate list queries and load team options only when editing. Follow the installed `herdr.d.ts` / `gpui-kit.d.ts`; Herdr has no Node APIs, DOM or `setTimeout`. A Web Encoding compatibility shim may be needed before Effect initializes. - The panel does **not** have an in-app key entry screen, OAuth, all-workspace search, project/cycle views, label editing, attachments or offline sync. The Agent button requires `linear-agent`; without it, browse/edit still work. Verify the selected repository before the dialog's Start agent action; a Linear team does not identify a Git checkout. - The sample preview masks all real issue data; publish a fictional-data image, not screenshots of private projects or API keys. Right-panel layout/tab clones are optional examples, **not** part of the distributable mod. ## Done when - `herdr-app check mods/lineardr` passes against the installed Herdr app and type declarations, and the mod visibly renders in-app. - With a **person-provided** key, the panel lists that account's assigned issues, filters/searches them, opens a detail with comments, and can create/edit/comment on a deliberately disposable test issue; an invalid key shows a safe error. - **Agent** opens the optional dialog with the chosen issue and repository choices, without starting a process until the person confirms. Installation instructions disclose that the dialog mod must already be installed. - The published repo contains `mods/lineardr/`, this recipe and `preview.png`, **no `layouts/` directory**, no credentials/private issue content, and any optional integration stored outside `mods/` and `layouts/`.