Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions e2e/web/tests/issue.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,29 @@ test('< widens the panel, and it stays', async ({ page }) => {
expect(Math.abs(await width() - w1)).toBeLessThan(2);
});

test('alt+i lists the attachments with who added them, and it stays', async ({ page, app }) => {
const png = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==', 'base64');
for (const [name, mimeType, buffer] of [['shot.png', 'image/png', png], ['export.csv', 'text/csv', Buffer.from('a,b\n')]]) {
const res = await page.request.post(app.url + '/api/issues/DEMO-4/attachments', { multipart: { file: { name, mimeType, buffer } } });
expect(res.ok()).toBeTruthy();
}
await page.reload();
const files = panel(page).locator('.sec-head', { hasText: 'Attachments' }).locator('..');
await expect(files.locator('.thumb', { hasText: 'shot.png' })).toBeVisible();
await expect(files.locator('.row-link', { hasText: 'export.csv' })).toContainText('Jamie Rivers');
await panel(page).click({ position: { x: 5, y: 5 } });
await page.keyboard.press('Alt+i');
await expect(files.locator('.thumb')).toHaveCount(0);
const row = files.locator('.row-link.file', { hasText: 'shot.png' });
await expect(row).toContainText('Jamie Rivers');
await expect(row.locator('time')).toBeVisible();
await page.reload();
await expect(files.locator('.row-link.file', { hasText: 'shot.png' })).toBeVisible();
await expect(files.locator('.thumb')).toHaveCount(0);
await files.getByRole('button', { name: 'Show as thumbnails' }).click();
await expect(files.locator('.thumb', { hasText: 'shot.png' })).toBeVisible();
});

// laneway-server's change stream (the demo has none: this stands in for it): someone else's comment
// shows in the open issue without a reload.
test.describe('on laneway-server', () => {
Expand Down
5 changes: 4 additions & 1 deletion internal/i18n/nl/web-board-issue.json
Original file line number Diff line number Diff line change
Expand Up @@ -818,5 +818,8 @@
"mute": "dempen",
"full screen": "volledig scherm",
"Picture-in-picture (p)": "Beeld-in-beeld (p)",
"picture-in-picture": "beeld-in-beeld"
"picture-in-picture": "beeld-in-beeld",
"Show as list": "Als lijst tonen",
"Show as thumbnails": "Als miniaturen tonen",
"attachments as list or thumbnails": "bijlagen als lijst of miniaturen"
}
19 changes: 18 additions & 1 deletion internal/jira/attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ type Attachment struct {
Filename string
MimeType string
Size int64
// Author is who uploaded it; Created when. Both are zero when Jira leaves them out.
Author string
Created time.Time
}

// IsImage reports whether the attachment is a picture the panel can draw.
Expand All @@ -38,6 +41,20 @@ type apiAttachment struct {
Filename string `json:"filename"`
MimeType string `json:"mimeType"`
Size int64 `json:"size"`
Author *user `json:"author"`
Created string `json:"created"`
}

// attachment is the file as the panels show it.
func (a apiAttachment) attachment() Attachment {
at := Attachment{ID: a.ID, Filename: safeterm.Line(a.Filename), MimeType: a.MimeType, Size: a.Size}
if a.Author != nil {
at.Author = safeterm.Line(a.Author.DisplayName)
}
if t, err := time.Parse("2006-01-02T15:04:05.999-0700", a.Created); err == nil {
at.Created = t
}
return at
}

// mediaRef is the placeholder target adfToMarkdown writes for a media node;
Expand Down Expand Up @@ -337,7 +354,7 @@ func (c *Client) issueMedia(ctx context.Context, a apiIssue) (files map[string]s
}
atts := make([]Attachment, len(a.Fields.Attachment))
for i, at := range a.Fields.Attachment {
atts[i] = Attachment{ID: at.ID, Filename: safeterm.Line(at.Filename), MimeType: at.MimeType, Size: at.Size}
atts[i] = at.attachment()
}
media = c.mediaFiles(ctx, atts)
if inline {
Expand Down
26 changes: 26 additions & 0 deletions internal/jira/attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"path/filepath"
"strings"
"testing"
"time"
)

func TestIssueResolvesMedia(t *testing.T) {
Expand Down Expand Up @@ -40,6 +41,31 @@ func TestIssueResolvesMedia(t *testing.T) {
}
}

func TestIssueAttachmentUploader(t *testing.T) {
body := `{"key":"ABC-1","fields":{"summary":"s","attachment":[
{"id":"10","filename":"shot.png","mimeType":"image/png","size":5,
"author":{"accountId":"a1","displayName":"Ann Lee"},"created":"2026-11-03T09:15:00.000+0100"},
{"id":"11","filename":"old.pdf","mimeType":"application/pdf","size":7}]}}`
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
_, _ = w.Write([]byte(body))
}))
defer srv.Close()
iss, err := New(Config{BaseURL: srv.URL, Email: "e", APIToken: "t"}).Get(context.Background(), "ABC-1")
if err != nil {
t.Fatal(err)
}
if len(iss.Attachments) != 2 {
t.Fatalf("attachments = %+v", iss.Attachments)
}
a := iss.Attachments[0]
if a.Author != "Ann Lee" || a.Created.UTC().Format(time.RFC3339) != "2026-11-03T08:15:00Z" {
t.Errorf("first = %+v, want Ann Lee at 2026-11-03T08:15:00Z", a)
}
if b := iss.Attachments[1]; b.Author != "" || !b.Created.IsZero() {
t.Errorf("without author or date = %+v, want both zero", b)
}
}

func TestAttachmentContent(t *testing.T) {
var gotPath, gotAuth string
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand Down
2 changes: 1 addition & 1 deletion internal/jira/jira.go
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ func (c *Client) toIssue(a apiIssue, files map[string]string, media map[string]A
iss.Labels = append(iss.Labels, safeterm.Line(l))
}
for _, at := range a.Fields.Attachment {
iss.Attachments = append(iss.Attachments, Attachment{ID: at.ID, Filename: safeterm.Line(at.Filename), MimeType: at.MimeType, Size: at.Size})
iss.Attachments = append(iss.Attachments, at.attachment())
}
iss.Description = resolveMedia(iss.Description, iss.Attachments, media)
iss.Links = issueLinks(a.Fields.Parent, a.Fields.IssueLinks, a.Fields.Subtasks)
Expand Down
2 changes: 1 addition & 1 deletion internal/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Scopes stack: global < view < panel (beside a board the panel's keys fire only w
| Picker | type to filter, `↑↓`/`ctrl+n` `ctrl+p` move, `enter` picks, `esc`; one that takes several (labels, list columns, assignee filter): `space` (nothing typed), `tab` (clears what was typed; typed text matching nothing becomes a new label) or a click ticks, `enter` or Apply takes them |
| Go | `g h` home, `g p` planning, `g r` reports, `g m` roadmap, `g w` my work, `g i` inbox, `g s` standup, `g a` agents, `g ,` settings, `g t` next theme, `g l` rules, `@` switch or add a Jira site (also with one site; the last row asks what `laneway setup` does, `POST /api/sites`, and the server starts again on it), `ctrl+a` ask the LLM about the issue (Edit as comment puts the answer in its comment composer, as the TUI; nothing posts until you do), your `ui.actions` keys |
| Board | `hjkl`/arrows move, `enter` open, `t` lanes/list, `s` status, `e` summary, `a` assign, `p` priority, `P` points, `H`/`L` move column (several statuses: pick one; a move the workflow wants fields for opens its form; `u` undoes; dragging splits such a lane into one drop zone per status, unreachable ones dimmed), `J`/`K` rank, `M` to a sprint or the backlog (marked cards, else the selected; `.` repeats it, `u` undoes), `E` quick edit (the card menu at the card; a right-click opens it at the pointer: current values, submenus for status, assignee, priority and sprint (the board's open sprints and the backlog), points, labels, pin, open in a new tab; `↑↓` `enter`/`→` `←`/`esc`; a long press on a phone keeps the sheet), `x` mark (`ctrl+click` too, the opened card with it; `shift+click` marks the run within the lane or list), `X` bulk, `o` Jira, `y` copy key, `r` refresh, `O` swimlanes (lanes) / sort (list; by assignee, priority, epic or status it heads each group with its count and points; a drop into another swimlane gives the card its assignee or epic, `u` undoes), `z`/`Z` fold/unfold swimlane, `c` compact (one-line) cards, `alt+e` hide/show empty lanes, `alt+l` next lane layout (`ui.lane_layouts`, arranged server-side by internal/lanes; stacked columns get a header over their first card), `C` list columns (drag a header onto another to move its column, its right edge to resize it, a double-click on the edge resets it; pref `board.colw`), `V` releases (the report), `F` filter builder (as the TUI's: `↑↓` pick, `→`/`tab` and `←`/`shift+tab` column, `enter` deeper then add, `ctrl+x` drop last term, `esc`), `*` pin, `.` repeat, `alt+j`/`alt+k` rank bottom/top, `ctrl+a` mark all, `ctrl+y` copy branch, `Y` copy link, `alt+t` time machine (`←` `→` `esc`), `alt+o` closed sprints, `B` board, `alt+p` project, `v` view, `[`/`]` previous/next view (sprints, backlog, `ui.views`, starred filters), `f` filter, `m` mine, `A` assignee (the project's assignable people; `space` (nothing typed), `tab` (clears what was typed) or a click ticks several, `enter` or Apply takes them, `enter` without a tick takes the row; `m` stays one toggle), `0` clear, `1`-`9` quick filters; the bar lists Mine, Assignee, then the quick filters (`ui.quick_filters` first); `is:notes` in `f` finds cards with private notes |
| Issue panel | A link to an issue on this site (descriptions, comments, notes, inbox, merge requests) draws as a pill, status, key, summary and assignee (`lib/issuepill.js`, `GET /api/issues/{key}/card`), and opens it here (a link with its own text keeps it); Details lists the edit screen's other fields (components, custom fields) after its own, a click edits one: the pinned ones (the pin on hover, the site's every project, shared with the TUI; its own fields pinned till unpinned; `PUT /api/fields/pinned/{id}`, `jira.FieldPins`), the rest under More (remembered open), `ui.empty_fields: hide` folds their empty ones; a filled rich-text field is a section under the description, edited like it (`GET`/`PUT /api/issues/{key}/doc/{field}`); a closed issue's fields come read-only from the screen last seen for its project and type (`jira/layout.go`); that screen also comes with the issue (`Issue.Screen`, its fields asked along), so the fields draw at once and editmeta changes nothing in place; `j`/`k` comment or scroll, `c` comment (`ctrl+o` in it: who sees it, everyone, an internal note or a project role), `R` reply, `e` summary (own focused comment), `E` description, `a` `p` `P` `l` assignee, priority, points, labels (Jira's complete as you type), `s` status, `L` link issue, `A` actions (subtask, link, each agent of the issue: type into, prompt, stop, a new agent in its directory; on a done issue remove its worktree once merged and clean; draft pull request when `jira.repos` has the project; clone (opens the create form filled in; creating links it), type, move, original estimate, dependency tree, delete, watchers, vote, flag, upload), `G` go to a linked issue (a Confluence page of this site, there or in Links, opens in place as markdown, its macros named, its images through `GET /api/confluence/images/{id}`, `GET /confluence/pages/{id}`; `ctrl+click` opens Confluence), `Backspace` back along the visible trail of followed issues (links, children, parent, `G`, palette; click a row to jump back; opening from the board resets it), `i` image viewer (arrows, `d` download), `d` delete own comment (`u` posts it back), a comment's Copy link copies its Jira link (`?focusedCommentId=`), `[`/`]` previous/next issue of the list beside, `1`-`4` tabs (`3` again steps History through Changes, Work log and All: comments, changes and work together; its box filters; a changed description shows the lines it changed), `4` Terminal (only while a herdr agent works on the issue: its live terminal; `4` again the next agent, `enter` or `ctrl+\` type, `t` take over input, `j`/`k` scroll back), `N` private notes, `D` development (in Details: pull requests, deploys, builds, branches, commits; `j`/`k` rows, `enter` open (a GitLab merge request unfolds: state, pipeline by stage, approvals, description; `GET /api/gitlab/mr?url=`; `d` its diff), `o` open in the browser, `r` reload, `y` copy branch/hash, `esc` back), `y`/`Y` copy key/link, `ctrl+y` copy branch, `*` pin, `<`/`>` widen/narrow (5%, stopping at `ui.panel_width`; a drag snaps to it within 3%, 20–80%), `o` Jira, `r` refresh, `ctrl+enter` save; a comment, comment edit or description being written is kept as a draft in the state file (shared with the TUI) and comes back after a reload; esc or Cancel with changes asks first; expands start folded |
| Issue panel | A link to an issue on this site (descriptions, comments, notes, inbox, merge requests) draws as a pill, status, key, summary and assignee (`lib/issuepill.js`, `GET /api/issues/{key}/card`), and opens it here (a link with its own text keeps it); Details lists the edit screen's other fields (components, custom fields) after its own, a click edits one: the pinned ones (the pin on hover, the site's every project, shared with the TUI; its own fields pinned till unpinned; `PUT /api/fields/pinned/{id}`, `jira.FieldPins`), the rest under More (remembered open), `ui.empty_fields: hide` folds their empty ones; a filled rich-text field is a section under the description, edited like it (`GET`/`PUT /api/issues/{key}/doc/{field}`); a closed issue's fields come read-only from the screen last seen for its project and type (`jira/layout.go`); that screen also comes with the issue (`Issue.Screen`, its fields asked along), so the fields draw at once and editmeta changes nothing in place; `j`/`k` comment or scroll, `c` comment (`ctrl+o` in it: who sees it, everyone, an internal note or a project role), `R` reply, `e` summary (own focused comment), `E` description, `a` `p` `P` `l` assignee, priority, points, labels (Jira's complete as you type), `s` status, `L` link issue, `A` actions (subtask, link, each agent of the issue: type into, prompt, stop, a new agent in its directory; on a done issue remove its worktree once merged and clean; draft pull request when `jira.repos` has the project; clone (opens the create form filled in; creating links it), type, move, original estimate, dependency tree, delete, watchers, vote, flag, upload), `G` go to a linked issue (a Confluence page of this site, there or in Links, opens in place as markdown, its macros named, its images through `GET /api/confluence/images/{id}`, `GET /confluence/pages/{id}`; `ctrl+click` opens Confluence), `Backspace` back along the visible trail of followed issues (links, children, parent, `G`, palette; click a row to jump back; opening from the board resets it), `i` image viewer (arrows, `d` download), `alt+i` attachments as thumbnails or a list (who added each and when; pref `issue.files`), `d` delete own comment (`u` posts it back), a comment's Copy link copies its Jira link (`?focusedCommentId=`), `[`/`]` previous/next issue of the list beside, `1`-`4` tabs (`3` again steps History through Changes, Work log and All: comments, changes and work together; its box filters; a changed description shows the lines it changed), `4` Terminal (only while a herdr agent works on the issue: its live terminal; `4` again the next agent, `enter` or `ctrl+\` type, `t` take over input, `j`/`k` scroll back), `N` private notes, `D` development (in Details: pull requests, deploys, builds, branches, commits; `j`/`k` rows, `enter` open (a GitLab merge request unfolds: state, pipeline by stage, approvals, description; `GET /api/gitlab/mr?url=`; `d` its diff), `o` open in the browser, `r` reload, `y` copy branch/hash, `esc` back), `y`/`Y` copy key/link, `ctrl+y` copy branch, `*` pin, `<`/`>` widen/narrow (5%, stopping at `ui.panel_width`; a drag snaps to it within 3%, 20–80%), `o` Jira, `r` refresh, `ctrl+enter` save; a comment, comment edit or description being written is kept as a draft in the state file (shared with the TUI) and comes back after a reload; esc or Cancel with changes asks first; expands start folded |
| Home | `ui.home`'s widgets, in its order, as the TUI's `~` (`internal/home`; with none set, `g h` shows every one and the board stays the start): my work (open), inbox (unread), the remembered board's active sprint (done against the time gone, behind when it trails by a tenth), the timer, waiting on my review, a count per starred Jira filter and starred search (`GET /home/sprint/{board}`, `GET /home/filters`); `jk`, `enter` opens the row (a search as a board view), a head's Open its view, `esc` the board, `r` refresh |
| Planning | `jk` move, `Home`/`End`, `PgUp`/`PgDn`, `J`/`K` rank, `m` move to sprint, `[`/`]` previous/next sprint, `x`/`space` select (`ctrl+click` too, the opened issue with it; `shift+click` selects the run), `z` fold, `enter` open, `P` points, `a` assignee, `e` quick edit, `X` bulk edit the marked, `o` Jira, `y` copy the section as a markdown table, `u` undoes a move, `N` `Z` `C` `E` new, start, complete (with `ui.delight` it says how the sprint ranks), edit sprint, `B` board, `alt+p` project, `f` filter (the board's query language), `F` filter builder, `A` filter by assignee (several, as on the board); the board's chips: Mine (no key: `m` moves), Assignee, `1`-`9` its quick filters (Jira narrows every section: `GET /plan/{board}?jql=`, which lists them as `QuickFilters`), `0` clear, `|` split (a second pane keeps one sprint or the backlog in view, picked in its bar and remembered per board, and leaves it out of the list; `>` moves there, `tab` or `h`/`l` switches pane, drag between panes; wide screens only), `O` sort, `R` reload; the list is the board's (`lib/cardlist.js`): a header click sorts within each section, again reverses, a third time back to rank (sorted, `J`/`K` don't rank and a drop goes to the section's end), each pane of the split sorts on its own (prefs `planning.sort.<board>`, `planning.sort.split.<board>`), Columns picks them, a dragged header moves one and its dragged edge resizes it (prefs `planning.cols`, `planning.colw`); a head counts the unestimated; each sprint head shows the points per assignee against `ui.capacity`, yours less your `ui.calendar` meetings in the sprint (the hours in its tooltip; `GET /plan/{board}` `Sprints[].Mine`) |
| Reports | `h`/`l`/`[`/`]`/arrows previous/next report, `1`-`7` pick, `s` sprint, `B` board, `alt+p` project, `W` weeks (cycle time), `d` the column done counts from (`ui.report_done`), `c` a second line for the visit (`?compare=`; burndown, burnup, flow, cycle time and retro; velocity and releases keep Jira's done), `r` release (releases; every released version listed, `enter` its issues as a board view), `y` copy the numbers as a markdown table, `R` reload, `jk` items |
Expand Down
4 changes: 4 additions & 0 deletions internal/web/static/css/issue.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ a.issue-ref { font-family: var(--font-mono); font-size: .95em; }
.thumb img { width: 100%; height: 5.714rem; object-fit: cover; border-radius: 3px; background: var(--bg-3); display: block; }
.thumb-video { position: relative; display: block; }
.thumb-video .ico { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 1.714rem; height: 1.714rem; padding: .357rem; border-radius: 50%; background: rgb(0 0 0 / .55); color: #fff; pointer-events: none; }
.row-link.file { gap: .571rem; } .row-link.file a.clip { color: inherit; } .row-link.file a.clip:hover { text-decoration: none; } .row-link.file > .dim { flex: none; font-size: .9em; }
.file-thumb { flex: none; width: 1.714rem; height: 1.714rem; border-radius: 3px; object-fit: cover; background: var(--bg-3); display: grid; place-items: center; color: var(--fg-2); }
.file-by { display: inline-flex; align-items: center; gap: .286rem; max-width: 10rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 40rem) { .row-link.file .file-by { display: none; } }
.md .md-video { --player-max-h: 25.714rem; margin: .4em auto; }
.lightbox { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; }

Expand Down
Loading