Skip to content
Eskais UI

Guides

Git views

A repository's history beside the selected commit, the working tree's staged and unstaged changes, a repository picker and a commit view, from CommitHistory, GitDiff, GitTree and RepositorySelect.

History beside the commit

CommitHistory takes about 40% of the width (at least 34rem) and keeps the selected commit with selected and onSelect: a press, Enter or Space selects a row, which carries aria-selected and the current-page look, and a press on the selected row opens its details. HEAD is selected at first. headerStart puts a RepositorySelect before the branch switcher, and upstreamHead marks the commits that aren't pushed. The pane beside it is a header and a GitDiff with a collapsible file tree, 13rem wide.

Read from the local checkout at ~/work/acme/api

Working tree clean on main · up to date with origin/main

1,284 commits

Add token-bucket rate limiting to the public API

Mara Lindqvist 9be07d2Parent 1210b70API-118
165 additions, 39 deletions
src
rate-limit
token-bucket.tsAdded33 additions, 0 deletions
token-bucket.test.tsAdded27 additions, 0 deletions
store.tsAdded16 additions, 0 deletions
redis-store.tsAdded15 additions, 0 deletions
index.tsAdded3 additions, 0 deletions
http
middleware
rate-limit.tsAdded24 additions, 0 deletions
index.tsModified1 addition, 1 deletion
server.tsModified6 additions, 2 deletions
errors.tsModified6 additions, 0 deletions
config
schema.tsModified5 additions, 1 deletion
defaults.tsModified1 addition, 1 deletion
auth
api-tokens.tsModified2 additions, 1 deletion
api-tokens.test.tsModified6 additions, 1 deletion
routes
public
index.tsModified1 addition, 1 deletion
metrics
counters.tsModified1 addition, 1 deletion
legacy
throttle.tsDeleted0 additions, 20 deletions
throttle.test.tsDeleted0 additions, 9 deletions
docs
api
rate-limits.mdRenamed12 additions, 1 deletion
package.jsonModified1 addition, 0 deletions
CHANGELOG.mdModified5 additions, 0 deletions
Addedsrc/rate-limit/token-bucket.ts33 additions, 0 deletions
@@ -0,0 +1,33 @@
Added, line 1
Added, line 2
Added, line 3
Added, line 4
Added, line 5
Added, line 6
Added, line 7
Added, line 8
Added, line 9
git-view.tsx
const [selected, setSelected] = useState<string | null>(dirty ? WORKING_TREE : head.id)
<div className="flex h-[50rem] gap-group">  <CommitHistory    aria-label={`History of ${repo.path}`}    className="w-2/5 min-w-136 shrink-0"    commits={commits}    branch={branch}    branches={branchNames}    onBranchChange={setBranch}    headerStart={      <RepositorySelect aria-label="Repository" size="sm" repositories={repositories} value={repo.id} onValueChange={setRepo} />    }    workingTree={dirty ? { staged: 2, unstaged: 3 } : undefined}    upstreamHead={upstreamHead} // git rev-parse @{u}: the commits above it are marked "not pushed"    selected={selected}    onSelect={setSelected}  />  {selected === WORKING_TREE ? <WorkingTreePane /> : <CommitPane commit={commitById(selected)} />}</div>

Uncommitted changes

On a dirty checkout, workingTree adds an "Uncommitted changes" row above the newest commit, with a hollow dashed node and the staged and unstaged counts. It shares the history's focus and selection as WORKING_TREE, so it can start selected. The pane shows the staged and unstaged changes read-only, one at a time behind a toggle, or both in one diff with groups: the file tree gets a section per group, each file header names its group, and a file staged and then edited again shows in each.

Read from the local checkout at ~/work/acme/app

2 not pushed2,310 commits
Uncommitted changes, 2 staged, 3 unstaged
Split src/pages/settings.tsx by section, 3 hours ago, not pushed
Remember the last project in local storage, 10 hours ago, not pushed
Debounce the search box on the events page, yesterday
Show the API token's expiry date, 2 days ago
Show rate-limit errors as a toast, 2 days ago
Remember the last project in local storage, 2 days ago
Fix the dark-mode chart colours, 2 days ago, app-4.8.0
Remember the last project in local storage, 3 days ago
Prefetch the account on hover, 3 days ago
Show the plan picker on the second onboarding step, 3 days ago
Skip the welcome step for invited members, 3 days ago
Load invoices with the cursor API, 3 days ago
Remember the last project in local storage, 3 days ago
Test the onboarding flow end to end, 4 days ago
Show the plan picker on the second onboarding step, 4 days ago
Debounce the search box on the events page, 4 days ago
Show rate-limit errors as a toast, 4 days ago
Retry failed uploads from the import dialog, 4 days ago
Translate the billing page to Spanish, 4 days ago
Show the API token's expiry date, 5 days ago
Remember the last project in local storage, 5 days ago
Show the plan picker on the second onboarding step, 6 days ago
Bump the design tokens to 3.2, 6 days ago
Replace the date picker on the export dialog, 6 days ago
Skip the welcome step for invited members, 7 days ago
Keep the sidebar collapsed across reloads, 7 days ago
Prefetch the account on hover, last week
Keep the sidebar collapsed across reloads, last week
Show the API token's expiry date, last week
Fix the dark-mode chart colours, last week
Load invoices with the cursor API, last week
Bump the design tokens to 3.2, last week
Remember the last project in local storage, last week
Bump the design tokens to 3.2, last week
Test the onboarding flow end to end, 2 weeks ago
Show the API token's expiry date, 2 weeks ago
Keep the sidebar collapsed across reloads, 2 weeks ago
Split src/pages/settings.tsx by section, 2 weeks ago
Replace the date picker on the export dialog, 2 weeks ago
Keep the sidebar collapsed across reloads, 2 weeks ago
Show the API token's expiry date, 2 weeks ago
Test the onboarding flow end to end, 2 weeks ago
Show the API token's expiry date, 2 weeks ago
Fix the dark-mode chart colours, 2 weeks ago
Fix the focus ring on the invite form, 2 weeks ago
Add an empty state to the webhooks page, 2 weeks ago
Load invoices with the cursor API, 2 weeks ago
Show the API token's expiry date, 2 weeks ago
Replace the date picker on the export dialog, 2 weeks ago
Fix the dark-mode chart colours, 2 weeks ago
Remember the last project in local storage, 2 weeks ago
Show rate-limit errors as a toast, 2 weeks ago
Bump the design tokens to 3.2, 2 weeks ago
Prefetch the account on hover, 2 weeks ago
Debounce the search box on the events page, 2 weeks ago
Split src/pages/settings.tsx by section, 2 weeks ago
Fix the dark-mode chart colours, 3 weeks ago
Show rate-limit errors as a toast, 3 weeks ago
Test the onboarding flow end to end, 3 weeks ago
Keep the sidebar collapsed across reloads, 3 weeks ago
Show the plan picker on the second onboarding step, 3 weeks ago
Show the plan picker on the second onboarding step, 3 weeks ago
Skip the welcome step for invited members, 3 weeks ago
Show rate-limit errors as a toast, 3 weeks ago
Replace the date picker on the export dialog, 3 weeks ago
Add an empty state to the webhooks page, 3 weeks ago
Fix the dark-mode chart colours, 3 weeks ago
Add an empty state to the webhooks page, 3 weeks ago
Skip the welcome step for invited members, 3 weeks ago
Add an empty state to the webhooks page, 3 weeks ago
Translate the billing page to Spanish, 3 weeks ago
Load invoices with the cursor API, 3 weeks ago
Bump the design tokens to 3.2, 3 weeks ago
Retry failed uploads from the import dialog, 3 weeks ago
Split src/pages/settings.tsx by section, 3 weeks ago
Retry failed uploads from the import dialog, 3 weeks ago
Fix the dark-mode chart colours, 3 weeks ago
Show the plan picker on the second onboarding step, 3 weeks ago
Fix the focus ring on the invite form, 3 weeks ago, app-4.7.0
Bump the design tokens to 3.2, 3 weeks ago
Retry failed uploads from the import dialog, 3 weeks ago
Add an empty state to the webhooks page, 3 weeks ago
Load invoices with the cursor API, 3 weeks ago
Show rate-limit errors as a toast, 4 weeks ago
Bump the design tokens to 3.2, 4 weeks ago
Split src/pages/settings.tsx by section, 4 weeks ago
Show the API token's expiry date, 4 weeks ago
Show the API token's expiry date, 4 weeks ago
Split src/pages/settings.tsx by section, 4 weeks ago
Translate the billing page to Spanish, 4 weeks ago
Remember the last project in local storage, 4 weeks ago
Retry failed uploads from the import dialog, 4 weeks ago
Fix the focus ring on the invite form, last month
Split src/pages/settings.tsx by section, last month
Prefetch the account on hover, last month
Load invoices with the cursor API, last month
Show rate-limit errors as a toast, last month
Bump the design tokens to 3.2, last month
Translate the billing page to Spanish, last month
Test the onboarding flow end to end, last month
Debounce the search box on the events page, last month
Add an empty state to the webhooks page, last month
Translate the billing page to Spanish, last month
Translate the billing page to Spanish, last month
Bump the design tokens to 3.2, last month
Add an empty state to the webhooks page, last month
Load invoices with the cursor API, last month
Debounce the search box on the events page, last month
Keep the sidebar collapsed across reloads, last month
Show the plan picker on the second onboarding step, last month
Keep the sidebar collapsed across reloads, last month
Show the API token's expiry date, last month
Split src/pages/settings.tsx by section, last month
Remember the last project in local storage, last month
Keep the sidebar collapsed across reloads, last month
Add an empty state to the webhooks page, last month
Bump the design tokens to 3.2, last month
Remember the last project in local storage, last month
Retry failed uploads from the import dialog, last month
Fix the focus ring on the invite form, last month
Prefetch the account on hover, last month
Add an empty state to the webhooks page, last month
Remember the last project in local storage, last month
Fix the focus ring on the invite form, last month
Test the onboarding flow end to end, last month
Translate the billing page to Spanish, last month
Fix the focus ring on the invite form, last month
Translate the billing page to Spanish, last month
Retry failed uploads from the import dialog, last month
Keep the sidebar collapsed across reloads, last month
Keep the sidebar collapsed across reloads, last month
Retry failed uploads from the import dialog, last month
Load invoices with the cursor API, last month
Remember the last project in local storage, last month
Prefetch the account on hover, last month
Replace the date picker on the export dialog, last month
Fix the focus ring on the invite form, last month
Split src/pages/settings.tsx by section, last month
Debounce the search box on the events page, last month
Prefetch the account on hover, last month
Show the plan picker on the second onboarding step, 2 months ago
Uncommitted changeson feat/onboarding-steps in app · read-only
21 additions, 1 deletion
src
onboarding
step-indicator.tsxAdded19 additions, 0 deletions
steps.tsxModified2 additions, 1 deletion
Addedsrc/onboarding/step-indicator.tsx19 additions, 0 deletions
@@ -0,0 +1,19 @@
Added, line 1
Added, line 2
Added, line 3
Added, line 4
Added, line 5
Added, line 6
Added, line 7
Added, line 8
Added, line 9
working-tree.tsx
// One group at a time, behind a read-only Staged/Unstaged toggle<GitDiff aria-label="Staged changes" patch={staged} fileTree="collapsible" />
// Or both, as sections of the file tree, each header naming its group<GitDiff  aria-label="Uncommitted changes"  groups={[    { label: "Staged", patch: staged },   // git diff --cached    { label: "Unstaged", patch: unstaged }, // git diff  ]}/>

Repository and branch

One history across the page, with the repository and branch in a toolbar above it. Each repository shows its path, its branch and its state; the branch select is a plain Select composition with ahead and behind counts.

Read from the local checkout at ~/work/acme/api, unpushed commits included

1,284 commits

A commit's files

The commit view replaces the history, like a route. A GitTree of every file at the commit drives the diff through currentFile and follows it through onCurrentFileChange; createDiffViewController(), exported from git-diff, does the same from code.

Add token-bucket rate limiting to the public API

Each API token gets a bucket of 120 requests that refills at 2 per second. Buckets live in Redis when REDIS_URL is set and in memory otherwise. Over the limit, the API answers 429 with retry-after and x-ratelimit-* headers. Replaces the fixed-window throttle in src/legacy.

Mara Lindqvist committed Nov 18, 2026, 4:12 PM UTC9be07d2Parent 4f1a9c3API-118
docs, Has changes
api, Has changes
authentication.md
pagination.md
rate-limits.md, Renamed, from docs/rate-limits.md
webhooks.md
errors.md
src, Has changes
auth, Has changes
api-tokens.test.ts, Modified
api-tokens.ts, Modified
hash.ts
sessions.ts
config, Has changes
defaults.ts, Modified
index.ts
schema.ts, Modified
http, Has changes
middleware, Has changes
cors.ts
index.ts, Modified
rate-limit.ts, Added
request-id.ts
timing.ts
errors.ts, Modified
health.ts
server.ts, Modified
legacy, Has changes
throttle.test.ts, Deleted
throttle.ts, Deleted
metrics, Has changes
counters.ts, Modified
registry.ts
rate-limit, Has changes
index.ts, Added
redis-store.ts, Added
store.ts, Added
token-bucket.test.ts, Added
token-bucket.ts, Added
routes, Has changes
public, Has changes
events.ts
index.ts, Modified
invoices.ts
webhooks.ts
main.ts
.editorconfig
.gitignore
.nvmrc
CHANGELOG.md, Modified
Dockerfile
README.md
docker-compose.yml
package.json, Modified
pnpm-lock.yaml
tsconfig.json
vitest.config.ts
165 additions, 39 deletions
Addedsrc/rate-limit/token-bucket.ts33 additions, 0 deletions
@@ -0,0 +1,33 @@
Added, line 1
Added, line 2
Added, line 3
Added, line 4
Added, line 5
Added, line 6
Added, line 7
Added, line 8
Added, line 9
commit-view.tsx
const [current, setCurrent] = useState<string | null>(null)
<GitTree aria-label="Files at 9be07d2" files={filesAtCommit} current={current} onOpenFile={setCurrent} /><GitDiff  aria-label="Changes in 9be07d2"  patch={patch}  fileTree={false}  currentFile={current}          // setting it scrolls the diff to that file  onCurrentFileChange={setCurrent} // the tree follows the diff as it scrolls/>

Changes in a scrolling dialog

  • height="auto" grows to the whole diff with no scroller of its own: the dialog body is the one scroller, and the diff still renders only the lines in view, reads find in page and moves the body with j/k. The file tree beside it stays in view, up to 40rem tall.
  • To cap a diff instead, set --diff-max-height on it or an ancestor: past it the diff scrolls inside, and at its top or bottom the wheel moves the dialog body on. Set the cap below the body's visible height, never in viewport units.
  • In split layout an added or deleted file shows its one side across the whole width.
task-changes.tsx
<Collapsible>  <CollapsibleTrigger>Changes</CollapsibleTrigger>  <CollapsiblePanel>    <GitDiff aria-label="Changes against main" patch={patch} height="auto" />  </CollapsiblePanel></Collapsible>