Skip to content

Repository files navigation

🥞 Shortstack

Chrome extension to export Github stack links cleanly and easily.

License: MIT Built with bun

If you use GitHub stacked pull requests, you know the ritual: someone asks what's in the stack, and you open four tabs and paste four long URLs into Slack. Shortstack reads the whole stack from whatever PR you're on and copies every link in one click, formatted for wherever it's going.

Shortstack copying a stack of PRs and pasting them into Slack as an indented quote block

What it does

  • Reads the stack straight from the PR page, in stack order
  • Shows each PR's state (open, draft, merged, closed) so you know what you're sharing
  • Filter presets for the usual cases: all PRs, open including drafts, open non-draft, not merged. Checkboxes if you want to hand-pick.
  • Copies in a few formats:
    • Slack (rich): pastes as an indented quote block, one PR per line, like [2/4] refactor(db): normalize user tables #1241, with the PR number as the link so messages stay short
    • Plain URLs, one per line
    • Markdown list or checklist, for PR descriptions and issues
    • Title and URL as plain text
  • Prefixes every line with its stack position ([1/4], [2/4], ...), counted from the base like GitHub does
  • Looks native to GitHub: Primer styling, dark by default, light mode toggle
  • No tokens, no API keys, no external requests. It talks to github.com with your existing session, so it works on any private repo you can already see.

Screenshots

Dark (default) Light
Popup in GitHub dark theme Popup in GitHub light theme

Install

Not on the Chrome Web Store yet, so load it from source:

git clone https://github.com/thomasthachil/shortstack.git
cd shortstack
bun install
bun run build

Then:

  1. Open chrome://extensions
  2. Turn on Developer mode (top right)
  3. Click Load unpacked and pick the dist/ folder
  4. Pin it from the puzzle-piece menu if you want it handy

Usage

Open any PR that belongs to a stack, click the icon, pick a filter and a format, hit Copy. That's it. Paste wherever.

How it works

GitHub server-renders the whole stack (number, title, url, state) into a JSON payload on every PR page. Shortstack fetches the current PR page once and searches that payload structurally rather than hardcoding a path into it, so GitHub reshuffling the payload shouldn't break anything. If the payload isn't there, it falls back to reading the live DOM, and as a last resort it scrapes the stack popover.

Because the fetch goes through your own browser session, private repos work and nothing leaves github.com.

Development

React, TypeScript, and Vite.

src/
├── content/index.ts      # content script: the three extraction strategies
├── lib/
│   ├── types.ts          # shared message and domain types
│   ├── stack.ts          # stack positions and filter predicates
│   └── format.ts         # copy formats and clipboard payloads
└── popup/
    ├── App.tsx           # popup root
    ├── components/       # StackList, StackRow, StateBadge, ThemeToggle
    ├── hooks/            # useStack (tab messaging), useTheme
    └── styles.css        # Primer design tokens, dark and light
bun run dev        # Vite dev server for the popup UI
bun run build      # type-check, then build the extension into dist/
bun run typecheck  # tsc --noEmit

Open the dev server with ?mock=1 to work on the popup against fixture data without loading the extension. The pages under docs/ are the framed mockups used to generate the README media; copy them into dist/ and serve that folder if you need to regenerate.

Known limitations

  • GitHub's stacked PRs feature is still in preview, so the payload shape may change. If extraction breaks, look at findStackArray in src/content/index.ts first.
  • Only GitHub's native stacks are detected. Stacks from third-party tools that just link PRs in the description aren't supported yet. PRs welcome.

License

MIT

About

Chrome extension to export Github stack links cleanly and easily

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages