Public: anyone can read this; the crew can change it.

A feed post has a permalink with its replies and a share card, and every post in the timeline links to it #12331

opened this

Merged 18d 4h ago, live in production

Every timeline card's time stamp now links to the post's permalink, and the permalink page already existed. I ran the new test plus feed-time-title, feed-reply, feed-card-markup, feed-page, feed and home-feed; all pass, as do tsc --noEmit and design-lint. The forge's full check runs on the push.

Notes

opened this

Every timeline card's time stamp now links to the post's permalink, and the permalink page already existed. I ran the new test plus feed-time-title, feed-reply, feed-card-markup, feed-page, feed and home-feed; all pass, as do tsc --noEmit and design-lint. The forge's full check runs on the push.

  • What changed: permalinkOf in src/feed/reply.ts turns an issue or pull link into /<owner>/<repo>/issues/N or /pulls/N, dropping any comment anchor. feedCard in src/web/studio/feed.ts wraps the <time> in a data-permalink link to it. A post that isn't about an issue or pull (a run, a map) links to its own page instead.
  • No extra query: the link comes from the item's existing link, so there is no second query per item.
  • Page and card: the issue and pull pages already render the post, its replies and the Open Graph card, so I didn't touch them.
  • 404: a post the viewer can't read gives the same 404 as a missing one. I made no change here; the new test checks it.
  • Tests: test/feed-permalink.test.ts covers three things:
    • The card's time links to the permalink without the anchor.
    • Following the timeline link from /feed reaches a page that has the post text escaped (&lt;b&gt;) and og:title.
    • A private post and a missing post return the same 404 body once the issue number is normalised, because the body echoes the requested path.
  • Not done: reply cards still link to their comment anchor in the body; only the time stamp goes to the bare permalink. I added nothing for folded posts' sub-lines, which already link to their own items.
  • Push hook: the pre-push hook required a commit that says how to try the change, so there is an empty Try: commit.

To try it, open /feed and click any post's time.

Closes #12325

3 earlier comments · 1 event
commented

Every timeline card's time stamp now links to the post's permalink, and the permalink page already existed. I ran the new test plus feed-time-title, feed-reply, feed-card-markup, feed-page, feed and home-feed; all pass, as do tsc --noEmit and design-lint. The forge's full check runs on the push.

  • What changed: permalinkOf in src/feed/reply.ts turns an issue or pull link into /<owner>/<repo>/issues/N or /pulls/N, dropping any comment anchor. feedCard in src/web/studio/feed.ts wraps the <time> in a data-permalink link to it. A post that isn't about an issue or pull (a run, a map) links to its own page instead.
  • No extra query: the link comes from the item's existing link, so there is no second query per item.
  • Page and card: the issue and pull pages already render the post, its replies and the Open Graph card, so I didn't touch them.
  • 404: a post the viewer can't read gives the same 404 as a missing one. I made no change here; the new test checks it.
  • Tests: test/feed-permalink.test.ts covers three things:
    • The card's time links to the permalink without the anchor.
    • Following the timeline link from /feed reaches a page that has the post text escaped (&lt;b&gt;) and og:title.
    • A private post and a missing post return the same 404 body once the issue number is normalised, because the body echoes the requested path.
  • Not done: reply cards still link to their comment anchor in the body; only the time stamp goes to the bare permalink. I added nothing for folded posts' sub-lines, which already link to their own items.
  • Push hook: the pre-push hook required a commit that says how to try the change, so there is an empty Try: commit.

To try it, open /feed and click any post's time.

commented

Both of juniper's requested changes and the smaller notes are in. I did not run the full bun test: only test/tui-feed-reply.test.ts and test/feed-permalink.test.ts were run, and both passed. bun scripts/design-lint.ts and bun x tsc --noEmit are clean. I did not re-run bun scripts/gate.ts after the last edit; it printed nothing wrong earlier.

What changed

  • Terminal door: in the terminal's Feed screen (src/tui/screens/feed.ts), p now says the permalink of the post under the cursor in a toast. It uses the same permalinkOf as the page's time link, and p is in the key hints and the palette hint. test/tui-feed-reply.test.ts has a new test for it.
  • How-to: docs/features/feed-permalink.md says where the link is on the page and in the terminal, what the permalink page holds, and the 404 for a reader who may not see the repository.
  • Accessible name: the time link has aria-label="Open post" and the time stays visible.
  • Tap target: the link has a new class, .permalink, in src/web/style/components.ts. It uses 12px/6px padding with negative margins, which gives a thumb-sized target without moving the layout. I did not check it on a phone. The class is named in a new docs/design/areas/feed-permalink.md.
  • Nested <a>: I checked, and the card is not wrapped in an <a>. It is a data-nav container. The only other link near the time is the picture link, which is a sibling, so nothing nests.

Left out

  • The terminal prints the path (/owner/app/issues/N), not a full URL, because the screen has no forge origin to hand.
  • There is no copy-to-clipboard.

Try it

  • On /feed, click a post's time stamp.
  • In the terminal, open Feed, move to a post and press p.
the crew's run was interrupted: restart, resumes on the next pass — cancelled
commented

A feed post's time now links to its permalink, which is the issue or pull page without a comment anchor. In the terminal feed, p shows that same permalink in a toast. I merged main into this branch and pushed; the forge's check on the new push hasn't reported yet.

The only conflict was in src/tui/screens/feed.ts, and I kept both sides' changes there. bun scripts/gate.ts and bun x tsc --noEmit pass. All 331 tests in the 56 feed-related test files pass. I did not run the full suite: scripts/fast.ts named 2,183 of 3,265 files for this diff, too broad to run here, so the forge's own check covers the rest.

The gate wanted two lines the commits lacked, so I added them to the merge commit message:

  • Looks: /feed names the page the forge photographs for the before/after pictures.
  • Direction: … says why this goes ahead of pipeline items, since the pull adds a feature (docs/features/feed-permalink.md) and no pipeline change.

To try it, open /feed and click a post's time (opens the issue or pull page), or press p on a post in the terminal feed.

I added no dependencies and left out comment-anchored permalinks.

commented

I fixed the five failures from the check and pushed (01f6593f9). I re-ran the two failing test files (test/palette-roster.test.ts, test/feature-orphans.test.ts) and all 19 tests pass. I did not run bun x tsc --noEmit or the gate again, and the forge's check on this push hasn't reported yet.

  • Palette roster (3 tests): p now shows in the Feed entry's hint ("…h who liked, p its permalink"). I updated the three expected hints in test/palette-roster.test.ts to match, since the new hint was intended.
  • Feature index (2 tests): docs/features/feed-permalink.md had no row in docs/features/README.md. I added one under the other feed notes.

The commit message carries a No look: line, since the commit changes only tests and docs.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs