diff --git a/README.md b/README.md index 477f242..4672893 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,8 @@ Better GitHub is a Chrome extension that enhances the GitHub experience. Inspire | :---: | :---: | | GitHub without Better GitHub | GitHub with Better GitHub | +Screenshots below are illustrative scenarios based on the extension UI, using `rrbe/better-github` throughout. + ## Feature Details ### Home @@ -28,7 +30,7 @@ Better GitHub is a Chrome extension that enhances the GitHub experience. Inspire
Screenshot - Better Top Repositories + Better Top Repositories
### PRs and issues @@ -37,37 +39,42 @@ Better GitHub is a Chrome extension that enhances the GitHub experience. Inspire
Screenshot - Default Sort by Updated + Default Sort by Updated
- **PR Branch Names** — Display source branch name next to each PR title. Click to copy.
Screenshot - PR Branch Names + PR Branch Names
- **PR Conflict Indicator** — Show a warning on PR list items that have merge conflicts. This is a read-only status and does not create or modify repository labels. Requires a token. +
+ Screenshot + PR Conflict Indicator +
+ - **PR Review Status** — Show review thread resolution status (resolved / unresolved) on the PR list. Only appears on PRs that have review threads; PRs without any review comments won't show a badge. Draft PRs are also excluded.
Screenshot - PR Review Status + PR Review Status
- **PR Diff Stats** — Show additions, deletions, and changed file count (e.g. `+223 −114 · 5 files`) on each row of the PR list. Requires a token.
Screenshot - PR Diff Stats + PR Diff Stats
- **PR Label Position** — Move labels to the front of PR titles for better visibility and scanning.
Screenshot - PR Label Position + PR Label Position
### PR details @@ -76,15 +83,14 @@ Better GitHub is a Chrome extension that enhances the GitHub experience. Inspire
Screenshot - PR Approve Now + PR Approve Now
- **Collapse/Expand All Files** — Add buttons to the diff toolbar to collapse or expand all file diffs in one click, plus a button inside the file tree to collapse or expand all folders. Works on PR, commit, and compare pages, and compatible with both the old and the new "Files changed" experience.
Screenshot - Collapse/Expand All Files - Collapse/Expand All Files + Collapse/Expand All Files
### Profile @@ -93,7 +99,7 @@ Better GitHub is a Chrome extension that enhances the GitHub experience. Inspire
Screenshot - Contributor Card + Contributor Card
### Commits @@ -102,20 +108,25 @@ Better GitHub is a Chrome extension that enhances the GitHub experience. Inspire
Screenshot - Commit Tags + Commit Tags
- **Commit Diff Stats** — Show additions, deletions, and changed file count (e.g. `+223 −114 · 5 files`) on each row of the commits list page. Requires a token.
Screenshot - Commit Diff Stats + Commit Diff Stats
### Repository - **Release Asset Downloads** — Show the download count for every release asset, including zero-download assets that GitHub may leave blank. GitHub's native counts are still rolling out; disable this feature in the extension options if both counts appear. +
+ Screenshot + Release Asset Downloads +
+ - **Releases Tab** — Add a Releases tab to the repository navigation bar for quick access.
@@ -127,23 +138,28 @@ Better GitHub is a Chrome extension that enhances the GitHub experience. Inspire
Screenshot - Watch/Fork/Star Popup + Watch/Fork/Star Popup
-- **Recent Commit Message Color** — Highlight recent commits with color based on their age, making it easy to spot the latest changes. Always on. +- **Recent Commit Age Color** — Color the relative commit times in the repository file list by age, making recent changes easier to spot. Always on.
Screenshot - Recent Commit Message Color + Recent Commit Age Color
### Features that cannot be disabled A few small features have little impact on the page experience. To avoid adding too many settings, they stay enabled after you install the extension: -- Recent Commit Message Color +- Recent Commit Age Color - Copy PR/Issue numbers +
+ Screenshot + Copy PR and issue numbers +
+ ## Installation ### Chrome Web Store diff --git a/README_CN.md b/README_CN.md index 981f2b8..580f5e4 100644 --- a/README_CN.md +++ b/README_CN.md @@ -20,6 +20,8 @@ Better GitHub 是一个增强 GitHub 使用体验的 Chrome 插件,灵感源 | :----------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------: | | 未使用 Better GitHub 的 GitHub 页面 | 使用 Better GitHub 后的 GitHub 页面 | +以下截图基于扩展界面制作示例场景,统一使用 `rrbe/better-github` 仓库。 + ## 功能详情 ### 首页 @@ -28,7 +30,7 @@ Better GitHub 是一个增强 GitHub 使用体验的 Chrome 插件,灵感源
示例截图 - Better Top Repositories + Better Top Repositories
### PR 和 Issue @@ -37,37 +39,42 @@ Better GitHub 是一个增强 GitHub 使用体验的 Chrome 插件,灵感源
示例截图 - 默认按更新时间排序 + 默认按更新时间排序
- **PR 分支名显示** — 在 PR 标题旁显示源分支名,点击即可复制。
示例截图 - PR 分支名与 Review 状态 + PR 分支名与 Review 状态
- **PR 冲突标识** — 在存在合并冲突的 PR 列表项上显示警告。只读取状态,不会创建或修改仓库 Label。需要 token。 +
+ 示例截图 + PR 冲突标识 +
+ - **PR Review 状态** — 在 PR 列表展示 review thread 的解决状态(已解决 / 未解决)。仅在 PR 存在 review thread 时显示,没有 review 评论的 PR 不会出现标记,draft PR 也不会。
示例截图 - PR Review 状态 + PR Review 状态
- **PR Diff 统计** — 在 PR 列表的每一行展示新增行数、删除行数与变更文件数(例如 `+223 −114 · 5 files`)。需要 token。
示例截图 - PR Diff 统计 + PR Diff 统计
- **PR Label 前置** — 将 PR 标签移到标题前方,提升可读性和浏览效率。
示例截图 - PR Label 前置 + PR Label 前置
### PR 详情页 @@ -76,15 +83,14 @@ Better GitHub 是一个增强 GitHub 使用体验的 Chrome 插件,灵感源
示例截图 - PR 快速 Approve + PR 快速 Approve
- **一键折叠/展开所有文件** — 在 diff 工具栏添加按钮,一键折叠或展开所有文件 diff;同时在文件树侧边栏添加按钮,一键折叠或展开所有目录。适用于 PR、commit 和 compare 页面,兼容新旧两种 "Files changed" 体验。
示例截图 - 一键折叠/展开所有文件 - 一键折叠/展开所有文件 + 一键折叠/展开所有文件
### 用户 @@ -93,7 +99,7 @@ Better GitHub 是一个增强 GitHub 使用体验的 Chrome 插件,灵感源
示例截图 - 贡献者背景卡 + 贡献者背景卡
### Commits @@ -102,20 +108,25 @@ Better GitHub 是一个增强 GitHub 使用体验的 Chrome 插件,灵感源
示例截图 - Commit 标签显示 + Commit 标签显示
- **Commit Diff 统计** — 在 commits 列表页的每一行展示新增行数、删除行数与变更文件数(例如 `+223 −114 · 5 files`)。需要 token。
示例截图 - Commit Diff 统计 + Commit Diff 统计
### 仓库页面 - **Release 资源下载量** — 显示每个 Release 资源的下载次数,包括 GitHub 可能留空的零下载资源。GitHub 原生下载量仍在灰度中;如果页面同时出现两份下载量,可在扩展选项中关闭此功能。 +
+ 示例截图 + Release 资源下载量 +
+ - **Releases Tab** — 在仓库导航栏添加 Releases 标签页,快速访问。
@@ -127,23 +138,28 @@ Better GitHub 是一个增强 GitHub 使用体验的 Chrome 插件,灵感源
示例截图 - Watch/Fork/Star 悬浮预览 + Watch/Fork/Star 悬浮预览
-- **最近提交 Commit Message 颜色** — 根据提交时间为最近的几个 commit message 添加颜色,帮助快速定位最新提交。常驻开启。 +- **最近提交时间着色** — 根据提交时间为仓库文件列表中的相对时间着色,帮助快速定位最近更新的文件。常驻开启。
示例截图 - 最近修改文件颜色 + 最近提交时间着色
### 无法关闭的功能 有一些小功能,对页面体验没有太多实质影响,我不想设置太多开关,于是装上插件后他们总是保持开启 -- 最近提交 Commit Message 颜色 +- 最近提交时间着色 - PR/Issue number copy +
+ 示例截图 + 复制 PR 和 Issue 编号 +
+ ## 安装 ### 通过 Chrome Web Store diff --git a/docs/promo/build.mjs b/docs/promo/build.mjs index 3970ed4..b7f4c9e 100644 --- a/docs/promo/build.mjs +++ b/docs/promo/build.mjs @@ -25,8 +25,8 @@ const NAME = "Better GitHub"; const defs = (side, glowX, glowY, glowR) => ` - - + + @@ -43,8 +43,8 @@ const marquee = ` ${NAME} - Improve usability of GitHub PR, issue & other pages - + See the details that matter, right on GitHub. + `; @@ -55,7 +55,7 @@ const small = ` ${NAME} - Improve GitHub PR & issue pages + Clearer pull requests and repos `; diff --git a/docs/promo/marquee.png b/docs/promo/marquee.png index b9d3716..4ebcf47 100644 Binary files a/docs/promo/marquee.png and b/docs/promo/marquee.png differ diff --git a/docs/promo/marquee.svg b/docs/promo/marquee.svg index 5445a72..194a451 100644 --- a/docs/promo/marquee.svg +++ b/docs/promo/marquee.svg @@ -2,8 +2,8 @@ - - + + @@ -15,7 +15,7 @@ Better GitHub - Improve usability of GitHub PR, issue & other pages - + See the details that matter, right on GitHub. + \ No newline at end of file diff --git a/docs/promo/small.png b/docs/promo/small.png index 3da1879..346dc70 100644 Binary files a/docs/promo/small.png and b/docs/promo/small.png differ diff --git a/docs/promo/small.svg b/docs/promo/small.svg index 3af5b8a..3d139b6 100644 --- a/docs/promo/small.svg +++ b/docs/promo/small.svg @@ -2,8 +2,8 @@ - - + + @@ -16,6 +16,6 @@ Better GitHub - Improve GitHub PR & issue pages + Clearer pull requests and repos \ No newline at end of file diff --git a/docs/screenshots/better-top-repositories.png b/docs/screenshots/better-top-repositories.png index dc3c65e..4e6f7b6 100644 Binary files a/docs/screenshots/better-top-repositories.png and b/docs/screenshots/better-top-repositories.png differ diff --git a/docs/screenshots/build.mjs b/docs/screenshots/build.mjs new file mode 100644 index 0000000..92b3bce --- /dev/null +++ b/docs/screenshots/build.mjs @@ -0,0 +1,155 @@ +// Render consistent, code-informed GitHub examples for the README and store. +// Requires Google Chrome on macOS. The repository names and PR titles come from +// rrbe/better-github; status/count combinations illustrate extension features. +import { spawn } from "node:child_process"; +import { existsSync, mkdtempSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { dirname, join, resolve } from "node:path"; +import { fileURLToPath, pathToFileURL } from "node:url"; + +const here = dirname(fileURLToPath(import.meta.url)); +const chrome = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"; +const temp = mkdtempSync(join(tmpdir(), "better-github-shots-")); +const logo = readFileSync(resolve(here, "../../static/icons/icon128.png")).toString("base64"); +const icon = `data:image/png;base64,${logo}`; +const optionsHTML = readFileSync(resolve(here, "../../static/options.html"), "utf8") + .replace('src="icons/icon48.png"', `src="${icon}"`) + .replace('', ""); +const optionsData = `data:text/html;base64,${Buffer.from(optionsHTML).toString("base64")}`; + +const css = ` +*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;color:#1f2328;background:#fff;font:14px -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif} +.top{height:64px;background:#0d1117;color:#f0f6fc;display:flex;align-items:center;gap:28px;padding:0 32px;font-size:15px}.top .mark{font-size:33px;line-height:1}.top .search{margin-left:auto;width:255px;border:1px solid #59636e;border-radius:6px;padding:8px 11px;color:#9198a1;font-size:13px}.top .signin{border:1px solid #59636e;border-radius:6px;padding:8px 13px} +.repo{height:65px;display:flex;align-items:center;padding:0 32px;gap:9px;background:#f6f8fa;border-bottom:1px solid #d1d9e0;font-size:20px}.repo a{color:#0969da;text-decoration:none}.repo strong{font-weight:600}.repo .public{font-size:12px;border:1px solid #d1d9e0;border-radius:20px;color:#59636e;padding:3px 8px;margin-left:6px}.repo .actions{margin-left:auto;display:flex;gap:8px}.button{background:#f6f8fa;border:1px solid #d1d9e0;border-radius:6px;padding:7px 12px;color:#1f2328;white-space:nowrap;font-size:13px}.button.green{background:#1f883d;color:white;border-color:#1f883d}.button .count{background:#eaeef2;border-radius:20px;padding:2px 7px;margin-left:6px} +.tabs{height:53px;display:flex;align-items:stretch;gap:26px;padding:0 32px;border-bottom:1px solid #d1d9e0;background:#f6f8fa}.tab{display:flex;align-items:center;gap:7px;padding:0 3px;color:#59636e;white-space:nowrap}.tab.active{color:#1f2328;border-bottom:2px solid #fd8c73;font-weight:600}.tab .counter{border-radius:20px;padding:1px 7px;background:#eaeef2;font-size:12px} +.body{padding:24px 32px}.titlebar{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.h1{font-size:22px;font-weight:600}.query{border:1px solid #d1d9e0;border-radius:6px;padding:10px 13px;color:#59636e;margin-bottom:20px;height:38px}.query b{color:#1f2328;font-weight:500}.query .highlight{color:#0969da;background:#ddf4ff}.list{border:1px solid #d1d9e0;border-radius:6px;overflow:hidden}.listhead{height:48px;display:flex;align-items:center;gap:18px;background:#f6f8fa;padding:0 17px;border-bottom:1px solid #d1d9e0}.listhead .spacer{flex:1}.listhead .muted{color:#59636e}.row{height:92px;padding:13px 18px 10px;display:flex;gap:13px;border-bottom:1px solid #d1d9e0}.row:last-child{border-bottom:none}.row .pricon{color:#1a7f37;font-size:20px;width:20px}.rowcontent{min-width:0;flex:1}.rowtitle{display:flex;align-items:center;gap:6px;font-weight:600;font-size:16px;white-space:nowrap}.rowtitle .link{overflow:hidden;text-overflow:ellipsis}.rowmeta{color:#59636e;font-size:12px;margin-top:7px}.info{display:flex;align-items:center;gap:5px;margin-top:7px;font-size:12px;white-space:nowrap}.badge{display:inline-flex;align-items:center;border-radius:12px;padding:2px 8px;font-size:11px;line-height:16px;font-weight:600}.branch{background:#ddf4ff;color:#0969da;border:1px solid #b6e3ff}.label{background:#eaeef2;color:#343b43}.label.purple{background:#ede8ff;color:#6f42c1}.label.green{background:#dafbe1;color:#1a7f37}.review{background:#fff8c5;color:#9a6700}.resolved{background:#dafbe1;color:#1a7f37}.conflict{background:#fbca04;color:#000;border:1px solid #fbca04}.diff{background:#f6f8fa;color:#1a7f37}.diff .del{color:#cf222e;margin-left:5px}.diff .files{color:#59636e;margin-left:5px}.muted{color:#59636e}.blue{color:#0969da}.divider{height:1px;background:#d8dee4;margin:16px 0} +.note{position:absolute;right:34px;bottom:28px;background:#fff;border:1px solid #d1d9e0;box-shadow:0 12px 35px #1f232820;border-radius:10px;padding:17px 20px;max-width:345px}.note strong{display:block;margin-bottom:7px;font-size:15px}.note p{margin:0;color:#59636e;line-height:1.5}.callout{box-shadow:0 0 0 3px #54aeff55;border-radius:5px} +.panel{border:1px solid #d1d9e0;border-radius:7px;background:#fff;overflow:hidden}.panelhead{padding:13px 17px;background:#f6f8fa;border-bottom:1px solid #d1d9e0;font-weight:600}.panelbody{padding:18px}.grid{display:grid;grid-template-columns:1fr 300px;gap:24px}.prtitle{font-size:28px;margin:8px 0 8px;font-weight:500}.state{background:#1f883d;color:white;border-radius:20px;padding:6px 14px;display:inline-block}.sideitem{padding:14px 0;border-bottom:1px solid #d8dee4}.sideitem:last-child{border-bottom:0}.reviewers{display:flex;justify-content:space-between;align-items:center}.reviewers a{color:#0969da;text-decoration:underline}.filebar{display:flex;justify-content:space-between;align-items:center;background:#f6f8fa;padding:12px 16px;border:1px solid #d1d9e0;border-radius:6px 6px 0 0}.code{height:160px;background:repeating-linear-gradient(to bottom,#fff 0 28px,#f6f8fa 28px 29px);border:1px solid #d1d9e0;border-top:0;font:13px ui-monospace,SFMono-Regular,monospace;color:#57606a;padding:16px 45px;line-height:29px}.code .add{background:#dafbe1;color:#1a7f37}.toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px} +.commits .row{height:77px}.tag{background:#dafbe1;color:#1a7f37;border-radius:20px;padding:3px 9px;font-size:12px;font-weight:500}.age{color:#bc4c00}.age.old{color:#9a6700}.asset{display:flex;justify-content:space-between;padding:11px 16px;border-bottom:1px solid #d1d9e0}.asset:last-child{border:0}.download{color:#1a7f37;background:#dafbe1;border-radius:12px;padding:3px 8px} +.dash{display:grid;grid-template-columns:290px 1fr;gap:25px;padding:22px 32px}.dash h2{font-size:16px}.repoitem{padding:11px 3px;border-bottom:1px solid #eaeef2;color:#0969da}.pin{float:right;color:#0969da}.feeditem{padding:16px 0;border-bottom:1px solid #d1d9e0;color:#59636e} +.hover{position:absolute;background:#fff;border:1px solid #d1d9e0;border-radius:8px;box-shadow:0 12px 30px #1f232830;width:310px;z-index:3}.hover .hh{padding:15px;border-bottom:1px solid #d1d9e0}.hover .hb{padding:14px}.hover .hf{border-top:1px solid #d1d9e0;text-align:center;padding:10px;color:#0969da;font-weight:600}.avatar{width:28px;height:28px;background:#dbeafe;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;margin-right:8px;color:#0969da}.settings{width:530px;margin:35px auto}.settings h1{font-size:23px}.setting{display:flex;justify-content:space-between;gap:20px;padding:13px 0;border-bottom:1px solid #d8dee4}.setting small{display:block;color:#59636e;line-height:1.35;margin-top:4px}.switch{width:34px;height:20px;border-radius:15px;background:#1f883d;flex:none;margin-top:2px}.switch:after{content:'';display:block;width:14px;height:14px;border-radius:50%;background:#fff;margin:3px 0 0 17px}.token{border:1px solid #d1d9e0;border-radius:6px;padding:10px;color:#59636e;margin-top:8px} +.feature-only .top{display:none}.feature-only .repo{height:56px}.feature-only .tabs{height:44px}.feature-only .body{padding:14px 24px}.feature-only .row{height:90px}.feature-only .h1{font-size:19px}.feature-only .query{margin-bottom:13px}.feature-only .listhead{height:40px}.feature-only .dash{padding:15px 24px}.feature-only .prtitle{font-size:23px} +.num{margin-right:4px}.focus-contributor .hover{top:160px!important}.focus-number .row:nth-child(2) .num{position:relative;cursor:copy}.focus-number .row:nth-child(2) .num::after{content:"Click to copy PR number";position:absolute;left:0;top:23px;padding:6px 9px;background:#24292f;color:white;border-radius:5px;white-space:nowrap;z-index:2}.focus-sort .query,.focus-branch .row:nth-child(2) .branch,.focus-conflict .row:nth-child(2) .conflict,.focus-review .row:nth-child(2) .review,.focus-diff .row:nth-child(2) .diff,.focus-label .row:nth-child(2) .label,.focus-number .row:nth-child(2) .num,.focus-approve .reviewers a,.focus-collapse .toolbar .button.callout,.focus-tags .commits .tag,.focus-commit-diff .commits .diff,.focus-downloads .download,.focus-tab .tab:last-child,.focus-age .age,.focus-top .pin{box-shadow:0 0 0 3px #54aeff88;border-radius:5px} +`; + +const top = `
Platform ▾Solutions ▾Resources ▾Open Source ▾
`; +const repo = `
▣  rrbe / better-githubPublic
♧   Notifications⑂   Fork 1☆   Star 1
`; +function tabs(active = "Pull requests", enhanced = true, prCount = 1) { + return `
${["Code", "Issues", "Pull requests", "Actions", "Projects", "Security", "Insights", ...(enhanced ? ["Releases"] : [])].map((t) => `
${({ Code: "⌘", Issues: "◉", "Pull requests": "⑂", Actions: "◉", Projects: "▦", Security: "⬡", Insights: "⌁", Releases: "♢" })[t]}  ${t}${t === "Pull requests" ? `${prCount}` : t === "Releases" ? '28' : ""}
`).join("")}
`; +} +const titles = [ + [58, "feat: show in-progress Actions count", "feat/actions-in-progress-count"], + [57, "fix: support current pull request list app", "fix/pr-list-repo-app"], + [56, "fix: support compact pull request dashboard density", "fix/compact-pr-dashboard"], + [55, "fix: support repository pull request dashboard preview", "fix/pr-dashboard-preview"], + [54, "feat: add release count to Releases tab", "feat/release-tab-count"], +]; +function prRow(i, enhanced = true) { + const [n, title, branch] = titles[i]; + const label = i === 0 ? "enhancement" : i === 1 ? "bug" : "documentation"; + const conflict = i === 2; + return `
⑂
${enhanced ? `${label}` : ""}${title}${enhanced ? `${branch}` : ""}
#${n} opened by rrbe · updated ${i + 1} days ago${!enhanced ? ` · ${label}` : ""}
${enhanced ? `
${i === 1 ? "1 unresolved" : "All resolved"}+${[458, 347, 182, 316, 329][i]}−${[34, 40, 8, 59, 6][i]}· ${[17, 17, 9, 11, 7][i]} files${conflict ? 'Conflicts' : ""}
` : ""}
`; +} +function prList(enhanced = true, order = [0, 1, 2, 3, 4]) { + return `${top}${repo}${tabs("Pull requests", enhanced, 5)}
All pull requestsNew pull request
⌕   is:pr state:open ${enhanced ? 'sort:updated-desc' : ""}
Open 5Closed 57Author   ▾Label   ▾Reviews   ▾Sort   ▾
${order.map((i) => prRow(i, enhanced)).join("")}
`; +} +function detail(kind) { + return `${top}${repo}${tabs()}
feat: show in-progress Actions count #58
⑂ Open   rrbe wants to merge 1 commit into main from feat/actions-in-progress-count
Conversation
Commits 1
Checks 2
Files changed 5
${kind === "collapse" ? `
Filter files...▤   Collapse all files   Submit review
▾   src/features/actions-in-progress-count.ts+42 −3
23  export function renderActionsCount() {
+   const count = await fetchCount();
+   updateNavigationBadge(count);
26  }
` : `
Conversation
rrrbe opened this pull request
Show the number of running workflows in repository navigation.
`}
Reviewers${kind === "approve" ? 'approve now' : ""}
No reviews yet
Labels
enhancement
`; +} +function commits(kind) { + return `${top}${repo}${tabs("Code")}
Commits
Commits on Sep 22, 2026
${[ + ["chore: bump version to 1.18.4", "v1.18.4", "+2 −2 · 2 files"], + ["fix: preserve trailing space in PR search input", "", "+18 −5 · 3 files"], + ["docs: sync English README with Chinese updates", "", "+30 −12 · 2 files"], + ["feat: support issue number copy", "", "+45 −3 · 4 files"], + ].map(([title, tag, stats], i) => `
●
${title}
r rrbe committed ${i + 1} days ago
${tag ? `◇ ${tag}` : ""}${kind === "stats" ? `${stats}` : ""}
${["536607f", "9c7472f", "c310beb", "a2eba71"][i]}
`).join("")}
`; +} +function releases(kind) { + return `${top}${repo}${tabs(kind === "tab" ? "Code" : "Releases")}
${kind === "tab" ? "better-github" : "Releases"}
${kind === "tab" ? `
Files and folders
📁 .github
📁 docs
📁 src
📄 README.md
` : `
v1.18.4   Latest
v1.18.4

Published by rrbe

Assets 1
better-github-v1.18.4.zip1 ⇩
Source code (zip)
Source code (tar.gz)
`}
`; +} +function dashboard() { + return `${top}
Top repositories   ⌕
${["rrbe/better-github", "rrbe/raycast-plugin-format-graphql", "rrbe/coding-island", "rrbe/grove", "rrbe/dev-tools"].map((r) => `
◉   ${r}◆
`).join("")}

Home

Activity
${["rrbe pushed to better-github", "rrbe opened a pull request in better-github", "rrbe released v1.18.4"].map((a) => `
◉   ${a}
`).join("")}
`; +} +function hover(kind) { + const base = prList(true).replace(/
.*$/s, ""); + if (kind === "contributor") return `${base}
rrrbe
Building small tools for GitHub.
Better GitHub
Account age   6 years
This repo   Returning contributor
PR history   57 PRs · 54 merged
Activity   Active this year
`; + return `${top}${repo}${tabs("Code")}
better-github

A Chrome extension that enhances the GitHub experience.

Repository
📁   docs

📁   src

📄   README.md
Stargazers1
r rrbe
View all
`; +} +function settings() { + return `${prList(true)}
`; +} +function bodyFor(id) { + switch (id) { + case "main_screenshot_without_better_github": return prList(false); + case "main_screenshot_with_better_github": return prList(true); + case "better-top-repositories": return dashboard(); + case "pr-issue-default-sort": return prList(true); + case "pr-branch-name": return prList(true); + case "pr-conflict-indicator": return prList(true, [2, 0, 1, 3, 4]); + case "pr-review-status": return prList(true, [1, 0, 2, 3, 4]); + case "pr-diff-stats": return prList(true); + case "pr-label-position": return prList(true); + case "pr-quick-approve": return detail("approve"); + case "pr-collapse-expand": return detail("collapse"); + case "contributor-card": return hover("contributor"); + case "commit-tags": return commits("tags"); + case "commit-diff-stats": return commits("stats"); + case "release-asset-downloads": return releases("assets"); + case "releases-tab": return releases("tab"); + case "watch-fork-star-popup": return hover("popup"); + case "file-age-color": return `${top}${repo}${tabs("Code")}
Latest commit   fix: preserve trailing space in PR search input   2 days ago
${[".github", "docs", "src", "static", "README.md"].map((n, i) => `
${n}${["2 days ago", "3 days ago", "7 days ago", "2 weeks ago", "last month"][i]}
`).join("")}
`; + case "number-copy": return prList(true); + case "store-pr-list": return prList(true); + case "store-pr-detail": return detail("collapse"); + case "store-releases": return releases("assets"); + case "store-contributor": return hover("contributor"); + case "store-settings": return settings(); + default: throw Error(`Unknown screenshot: ${id}`); + } +} + +const readme = [ + "main_screenshot_without_better_github", "main_screenshot_with_better_github", + "better-top-repositories", "pr-issue-default-sort", "pr-branch-name", + "pr-conflict-indicator", "pr-review-status", "pr-diff-stats", "pr-label-position", + "pr-quick-approve", "pr-collapse-expand", "contributor-card", "commit-tags", + "commit-diff-stats", "release-asset-downloads", "releases-tab", + "watch-fork-star-popup", "file-age-color", "number-copy", +]; +const store = ["store-pr-list", "store-pr-detail", "store-releases", "store-contributor", "store-settings"]; + +try { + const selected = process.argv.slice(2); + for (const id of [...readme, ...store].filter((name) => selected.length === 0 || selected.includes(name))) { + const isStore = id.startsWith("store-"); + const overview = id.startsWith("main_screenshot_"); + const width = isStore || overview ? 1280 : 1200; + const height = isStore || overview ? 800 : 500; + const focus = ({ "better-top-repositories": "top", "pr-issue-default-sort": "sort", "pr-branch-name": "branch", "pr-conflict-indicator": "conflict", "pr-review-status": "review", "pr-diff-stats": "diff", "pr-label-position": "label", "pr-quick-approve": "approve", "pr-collapse-expand": "collapse", "contributor-card": "contributor", "commit-tags": "tags", "commit-diff-stats": "commit-diff", "release-asset-downloads": "downloads", "releases-tab": "tab", "file-age-color": "age", "number-copy": "number" })[id] ?? ""; + const html = `${bodyFor(id)}`; + const source = join(temp, `${id}.html`); + const output = resolve(here, isStore ? `chrome-web-store/${id.slice(6)}.png` : `${id}.png`); + writeFileSync(source, html); + rmSync(output, { force: true }); + await new Promise((resolveShot, rejectShot) => { + const child = spawn(chrome, ["--headless=new", "--disable-gpu", "--no-first-run", "--no-default-browser-check", `--user-data-dir=${join(temp, id)}`, `--window-size=${width},${height}`, `--screenshot=${output}`, pathToFileURL(source).href], { stdio: "ignore", detached: true }); + const start = Date.now(); + const timer = setInterval(() => { + if (existsSync(output) && statSync(output).size > 0) { + clearInterval(timer); + try { process.kill(-child.pid, "SIGTERM"); } catch { /* Chrome already exited. */ } + resolveShot(); + } else if (Date.now() - start > 20000) { + clearInterval(timer); + try { process.kill(-child.pid, "SIGTERM"); } catch { /* Chrome already exited. */ } + rejectShot(new Error(`Timed out rendering ${id}`)); + } + }, 100); + child.on("error", rejectShot); + }); + console.log(`${id}: ${width}x${height}`); + } +} finally { + await new Promise((resolveDone) => setTimeout(resolveDone, 1000)); + rmSync(temp, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 }); +} diff --git a/docs/screenshots/chrome-web-store/Better-Github-Access-Token-Setting.png b/docs/screenshots/chrome-web-store/Better-Github-Access-Token-Setting.png deleted file mode 100644 index f4ebefc..0000000 Binary files a/docs/screenshots/chrome-web-store/Better-Github-Access-Token-Setting.png and /dev/null differ diff --git a/docs/screenshots/chrome-web-store/Better-Github-Feature-Setting.png b/docs/screenshots/chrome-web-store/Better-Github-Feature-Setting.png deleted file mode 100644 index 7d54716..0000000 Binary files a/docs/screenshots/chrome-web-store/Better-Github-Feature-Setting.png and /dev/null differ diff --git a/docs/screenshots/chrome-web-store/Better-Github.png b/docs/screenshots/chrome-web-store/Better-Github.png deleted file mode 100644 index b6bea87..0000000 Binary files a/docs/screenshots/chrome-web-store/Better-Github.png and /dev/null differ diff --git a/docs/screenshots/chrome-web-store/contributor.png b/docs/screenshots/chrome-web-store/contributor.png new file mode 100644 index 0000000..7d6f816 Binary files /dev/null and b/docs/screenshots/chrome-web-store/contributor.png differ diff --git a/docs/screenshots/chrome-web-store/pr-detail.png b/docs/screenshots/chrome-web-store/pr-detail.png new file mode 100644 index 0000000..fa3f0fd Binary files /dev/null and b/docs/screenshots/chrome-web-store/pr-detail.png differ diff --git a/docs/screenshots/chrome-web-store/pr-list.png b/docs/screenshots/chrome-web-store/pr-list.png new file mode 100644 index 0000000..ac956b6 Binary files /dev/null and b/docs/screenshots/chrome-web-store/pr-list.png differ diff --git a/docs/screenshots/chrome-web-store/releases.png b/docs/screenshots/chrome-web-store/releases.png new file mode 100644 index 0000000..584c4f3 Binary files /dev/null and b/docs/screenshots/chrome-web-store/releases.png differ diff --git a/docs/screenshots/chrome-web-store/settings.png b/docs/screenshots/chrome-web-store/settings.png new file mode 100644 index 0000000..2e1f60d Binary files /dev/null and b/docs/screenshots/chrome-web-store/settings.png differ diff --git a/docs/screenshots/commit-diff-stats.png b/docs/screenshots/commit-diff-stats.png new file mode 100644 index 0000000..8b6f125 Binary files /dev/null and b/docs/screenshots/commit-diff-stats.png differ diff --git a/docs/screenshots/commit-tags.png b/docs/screenshots/commit-tags.png index ab39a97..c6d3234 100644 Binary files a/docs/screenshots/commit-tags.png and b/docs/screenshots/commit-tags.png differ diff --git a/docs/screenshots/contributor-card.png b/docs/screenshots/contributor-card.png index 6e1330d..60f0e13 100644 Binary files a/docs/screenshots/contributor-card.png and b/docs/screenshots/contributor-card.png differ diff --git a/docs/screenshots/file-age-color.png b/docs/screenshots/file-age-color.png index 8eed4c3..b71c7ea 100644 Binary files a/docs/screenshots/file-age-color.png and b/docs/screenshots/file-age-color.png differ diff --git a/docs/screenshots/main_screenshot_with_better_github.png b/docs/screenshots/main_screenshot_with_better_github.png index 39e047a..ac956b6 100644 Binary files a/docs/screenshots/main_screenshot_with_better_github.png and b/docs/screenshots/main_screenshot_with_better_github.png differ diff --git a/docs/screenshots/main_screenshot_without_better_github.png b/docs/screenshots/main_screenshot_without_better_github.png index 91895e6..ce959f0 100644 Binary files a/docs/screenshots/main_screenshot_without_better_github.png and b/docs/screenshots/main_screenshot_without_better_github.png differ diff --git a/docs/screenshots/number-copy.png b/docs/screenshots/number-copy.png new file mode 100644 index 0000000..befc5e7 Binary files /dev/null and b/docs/screenshots/number-copy.png differ diff --git a/docs/screenshots/pr-branch-name.png b/docs/screenshots/pr-branch-name.png index 3207f0f..bc5c4e6 100644 Binary files a/docs/screenshots/pr-branch-name.png and b/docs/screenshots/pr-branch-name.png differ diff --git a/docs/screenshots/pr-collapse-expand-1.png b/docs/screenshots/pr-collapse-expand-1.png deleted file mode 100644 index a3a2aa3..0000000 Binary files a/docs/screenshots/pr-collapse-expand-1.png and /dev/null differ diff --git a/docs/screenshots/pr-collapse-expand-2.png b/docs/screenshots/pr-collapse-expand-2.png deleted file mode 100644 index 3aa0884..0000000 Binary files a/docs/screenshots/pr-collapse-expand-2.png and /dev/null differ diff --git a/docs/screenshots/pr-collapse-expand.png b/docs/screenshots/pr-collapse-expand.png new file mode 100644 index 0000000..8989ba4 Binary files /dev/null and b/docs/screenshots/pr-collapse-expand.png differ diff --git a/docs/screenshots/pr-commit-diff-stats.png b/docs/screenshots/pr-commit-diff-stats.png deleted file mode 100644 index ce3a1ed..0000000 Binary files a/docs/screenshots/pr-commit-diff-stats.png and /dev/null differ diff --git a/docs/screenshots/pr-conflict-indicator.png b/docs/screenshots/pr-conflict-indicator.png new file mode 100644 index 0000000..30e6a80 Binary files /dev/null and b/docs/screenshots/pr-conflict-indicator.png differ diff --git a/docs/screenshots/pr-diff-stats.png b/docs/screenshots/pr-diff-stats.png new file mode 100644 index 0000000..7825cad Binary files /dev/null and b/docs/screenshots/pr-diff-stats.png differ diff --git a/docs/screenshots/pr-issue-default-sort.png b/docs/screenshots/pr-issue-default-sort.png index 39d879e..f3a2db4 100644 Binary files a/docs/screenshots/pr-issue-default-sort.png and b/docs/screenshots/pr-issue-default-sort.png differ diff --git a/docs/screenshots/pr-label-position.png b/docs/screenshots/pr-label-position.png index 2bfbf52..58b62b5 100644 Binary files a/docs/screenshots/pr-label-position.png and b/docs/screenshots/pr-label-position.png differ diff --git a/docs/screenshots/pr-quick-approve.png b/docs/screenshots/pr-quick-approve.png index 814a5fc..1c9cc21 100644 Binary files a/docs/screenshots/pr-quick-approve.png and b/docs/screenshots/pr-quick-approve.png differ diff --git a/docs/screenshots/pr-review-status.png b/docs/screenshots/pr-review-status.png index a614497..bb54f0e 100644 Binary files a/docs/screenshots/pr-review-status.png and b/docs/screenshots/pr-review-status.png differ diff --git a/docs/screenshots/release-asset-downloads.png b/docs/screenshots/release-asset-downloads.png new file mode 100644 index 0000000..1e41ad4 Binary files /dev/null and b/docs/screenshots/release-asset-downloads.png differ diff --git a/docs/screenshots/releases-tab.png b/docs/screenshots/releases-tab.png index c596c70..694319c 100644 Binary files a/docs/screenshots/releases-tab.png and b/docs/screenshots/releases-tab.png differ diff --git a/docs/screenshots/watch-fork-star-popup.png b/docs/screenshots/watch-fork-star-popup.png index d8ade5f..60477dc 100644 Binary files a/docs/screenshots/watch-fork-star-popup.png and b/docs/screenshots/watch-fork-star-popup.png differ