Skip to content

Open-source status page, incident response and uptime monitoring

feat: add pagination navigation to compare pages (#1869)

Maximilian Kaske4de8d54096f4
diff --git a/.claude/commands/ship.md b/.claude/commands/ship.md
new file mode 100644
index 000000000..e063ec98e
--- /dev/null
+++ b/.claude/commands/ship.md
@@ -0,0 +1,85 @@
+---
+description: Create a new git branch, commit changes, and create a pull request
+allowed-tools: Bash(git:*), Bash(gh:*)
+---
+
+# Current Git State
+
+- Branch: !`git branch --show-current`
+- Status: !`git status --porcelain`
+- Recent commits: !`git log --oneline -5`
+
+# Arguments
+
+$ARGUMENTS - optional branch name
+
+# Workflow
+
+## 1. Validate
+
+- Confirm there are uncommitted changes (from status above). If none, stop.
+- Confirm current branch. If not on `main`, ask user before proceeding.
+- Warn if any .env or credential files would be staged.
+- Run `pnpm format:fix` in the root directory to fix formatting issues
+
+## 2. Create Branch
+
+- If `$ARGUMENTS` provided, use it as branch name
+- Otherwise, generate from task context using conventional prefixes: `feat/`, `fix/`, `chore/`, `refactor/`, `docs/` in kebab-case
+
+```bash
+git checkout -b <branch-name>
+```
+
+## 3. Commit
+
+1. Run `git diff` to review all changes
+2. **Think about context**: What was the user trying to achieve? What problem does this solve?
+3. Draft commit message:
+ - Conventional commit format: `feat:`, `fix:`, `chore:`, `docs:`, `refactor:`
+ - **Write at the outcome level, not implementation level**
+ - Bad: "change timeout from 5000 to 10000 in checker/monitor.go"
+ - Good: "increase monitor check timeout to handle slow API responses"
+4. Stage relevant files (not .env/credentials)
+5. Commit with heredoc format:
+
+```bash
+git commit -m "$(cat <<'EOF'
+<message>
+
+Co-Authored-By: Claude Opus 4.6 <[email protected]>
+EOF
+)"
+```
+
+6. Run `git status` to verify success
+
+## 4. Push & Create PR
+
+```bash
+git push -u origin <branch-name>
+```
+
+Create PR with `gh`:
+
+- Title from commit message (same high-level framing)
+- Summary explains **outcomes**, not file changes
+ - Bad: "Added `getMonitorStatus()` to monitor.ts, updated `Monitor` type"
+ - Good: "Status pages now reflect real-time monitor degradation states"
+
+```bash
+gh pr create --title "<title>" --body "$(cat <<'EOF'
+## Summary
+- <outcome 1>
+- <outcome 2>
+
+🤖 Generated with [Claude Code](https://claude.com/claude-code)
+EOF
+)"
+```
+
+Return the PR URL.
+
+## Error Handling
+
+If any step fails, report the error and stop. Don't proceed to the next step.
diff --git a/apps/web/src/app/(landing)/compare/[slug]/page.tsx b/apps/web/src/app/(landing)/compare/[slug]/page.tsx
index ad418468d..261756e15 100644
--- a/apps/web/src/app/(landing)/compare/[slug]/page.tsx
+++ b/apps/web/src/app/(landing)/compare/[slug]/page.tsx
@@ -1,3 +1,4 @@
+import { ContentPagination } from "@/app/(landing)/content-pagination";
import { CustomMDX } from "@/content/mdx";
import { getComparePages } from "@/content/utils";
import { BASE_URL, getPageMetadata } from "@/lib/metadata/shared-metadata";
@@ -46,7 +47,14 @@ export default async function Blog({
params: Promise<{ slug: string }>;
}) {
const { slug } = await params;
- const post = getComparePages().find((post) => post.slug === slug);
+ const posts = getComparePages().sort(
+ (a, b) =>
+ b.metadata.publishedAt.getTime() - a.metadata.publishedAt.getTime(),
+ );
+ const postIndex = posts.findIndex((post) => post.slug === slug);
+ const post = posts[postIndex];
+ const previousPost = posts[postIndex - 1];
+ const nextPost = posts[postIndex + 1];
if (!post) {
notFound();
@@ -78,6 +86,11 @@ export default async function Blog({
<h1>{post.metadata.title}</h1>
<p className="text-lg">{post.metadata.description}</p>
<CustomMDX source={post.content} />
+ <ContentPagination
+ previousPost={previousPost}
+ nextPost={nextPost}
+ prefix="/compare"
+ />
</section>
);
}