Commit 105ddf4
feat(web): add git history view (#1150)
* feat(web): show latest commit header in file browser
Adds a GitHub-style commit row below the path header on the file browse
view, showing the author, message, short SHA, and relative date for the
most recent commit that touched the file. A no-op History button is
included as a placeholder for the upcoming file-history view.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(web): support co-authors and commit body in commit header
Parse Co-authored-by trailers from the commit body and display an
AvatarGroup with the combined author list, falling back to an overflow
count when more than two. Add a toggle button next to the commit
message to reveal the full commit body inline.
Upgrades the Avatar ui component to include AvatarGroup, AvatarGroupCount,
and AvatarBadge primitives.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(web): add commits pathType and wire History button
Extend the browse URL scheme to support /-/commits/<path> as a third
pathType alongside blob and tree. Empty paths are permitted so the same
route can later serve repo-level history.
The History button in the commit header now links to this route via
getBrowsePath. The page renders a placeholder for the commits pathType;
the actual commit list panel will follow.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(web): add commit history view
Render a paginated commit history list when pathType is commits. The
view reuses PathHeader for the "History for <repo> / <path>" subheader,
groups commits by local date with sticky section headers, and shows
Previous/Next links driven by a page query param.
Each row renders the commit message, co-authors, short SHA, copy action,
view-code-at-commit, and view-repo-at-commit links. When on the last
page the list ends with an "End of commit history" marker.
Refactor the author parsing, avatar group, body toggle, and body panel
out of commitHeader into commitAuthors.ts and commitParts.tsx so the
new CommitRow can reuse them.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(web): add GET /api/commits/authors endpoint
List unique commit authors scoped to a ref and optional path, sorted by
commit count descending. Backed by git shortlog -sne for a native walk
that emits one line per author rather than per commit, which keeps the
response small even for files with long histories.
The route is exposed in the public API under the Git tag.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(web): add author filter to commit history view
The history subheader gets an "All users" dropdown that filters commits
by author. The top 100 authors (by commit count) are fetched via
listCommitAuthors and shown in a Popover + cmdk Command list with a
search input, checkmark on the selected author, and a "View commits for
all users" footer to clear. A "Filter on author <input>" row appears at
the top whenever search is non-empty, acting as an escape valve for
authors outside the top 100.
The filter survives pagination by threading the author query param
through CommitsPagination. Duplicate entries from the same email (git
shortlog groups by full author string, so name-variant spellings split
into multiple rows) are collapsed client-side with the name variant
having the most commits winning as canonical.
Document listCommits's --author and --grep as POSIX BRE regex and move
the literal-escape responsibility onto the caller; CommitsPanel escapes
the selected author via a BRE-safe helper before passing to git.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(web): add date range filter to commit history view
Adds a date range dropdown next to the author filter using shadcn's
range Calendar in a Popover. URL state is `?since=YYYY-MM-DD&until=YYYY-MM-DD`
so ranges are shareable.
Two clicks are required to form a range even when one is already
selected — the component tracks an in-progress draft locally and
intercepts react-day-picker v9's "adjust" behavior that would otherwise
commit a new range in a single click. Single-day ranges require two
clicks of the same date.
The upper bound is made inclusive by appending end-of-day time before
passing to git log. `since` also gets explicit midnight time to sidestep
git's approxidate parser, which silently mishandles some bare
YYYY-MM-DD forms. Future dates are disabled.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore: add CHANGELOG entry for git history view
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(web): add History tab to bottom panel with latest-commit summary
Adds a new History tab to the bottom panel alongside Explore. The tab is
toggled via shift+mod+h with the existing collapse-on-same/switch-on-other
semantics, and the active tab is indicated with an underline using
LowProfileTabsTrigger (now accepts an optional className).
The history panel itself is a client-side infinite-scroll list (react-query
useInfiniteQuery + IntersectionObserver) that hits a new client-side
listCommits wrapper. Each row reuses AuthorsAvatarGroup, the co-author
parsing, and the new shared CommitActionLink primitive for the
view-code-at-commit / view-repo-at-commit actions. CommitRow was refactored
to use the same primitive.
The previous CommitHeader rendered above each open file is removed.
A compact summary of the latest commit now appears in the bottom panel
header (right side) whenever the panel is collapsed, so the file/folder's
last commit stays glanceable without consuming a full row above the code.
When the panel is expanded the right side hosts the View-full-history
and Hide buttons.
Shared commit utilities (commitAuthors.ts, commitParts.tsx) moved up
from browse/[...path]/components/ to browse/components/ so both the
existing commits view and the new bottom-panel components import them
without crossing route boundaries.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(web): resolve path type for the commits view and tighten path handling
The commits view URL pattern (/-/commits/<path>) doesn't carry whether
the path is a file or a folder, so PathHeader was rendering folder
paths with the file-icon last-segment treatment. Add a small
getPathType helper backed by `git cat-file -t <ref>:<path>` and use it
to pick the correct PathHeader behaviour. CommitRow and HistoryRow now
gate the "view code at this commit" action on the same blob check so
the file-only link doesn't appear on folder rows.
Also fix a related path-handling bug: PathHeader's repo-name link
called getBrowsePath with `path: '/'`, which encoded as `%2F` and
parsed back as `path: '/'` — that leaked through as `git log -- /`,
which git correctly rejects with "outside repository". Strip leading
slashes both when generating and when parsing browse URLs so any path
that comes through as a literal `/` resolves to the repo root.
When clicking "View full history" the bottom panel now collapses
on the same click, so the new full-view page renders without the
panel still hovering on top of it.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feedback
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 3ab245a commit 105ddf4
32 files changed
Lines changed: 2247 additions & 125 deletions
File tree
- docs
- api-reference
- packages/web
- src
- app
- (app)/browse
- [...path]
- components
- components
- hooks
- api
- (client)
- (server)/commits/authors
- components/ui
- features/git
- openapi
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
965 | 965 | | |
966 | 966 | | |
967 | 967 | | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
968 | 994 | | |
969 | 995 | | |
970 | 996 | | |
| |||
1731 | 1757 | | |
1732 | 1758 | | |
1733 | 1759 | | |
1734 | | - | |
| 1760 | + | |
1735 | 1761 | | |
1736 | 1762 | | |
1737 | | - | |
| 1763 | + | |
1738 | 1764 | | |
1739 | 1765 | | |
1740 | 1766 | | |
| |||
1761 | 1787 | | |
1762 | 1788 | | |
1763 | 1789 | | |
1764 | | - | |
| 1790 | + | |
1765 | 1791 | | |
1766 | 1792 | | |
1767 | | - | |
| 1793 | + | |
1768 | 1794 | | |
1769 | 1795 | | |
1770 | 1796 | | |
| |||
1944 | 1970 | | |
1945 | 1971 | | |
1946 | 1972 | | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
| 2004 | + | |
| 2005 | + | |
| 2006 | + | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
| 2029 | + | |
| 2030 | + | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
1947 | 2094 | | |
1948 | 2095 | | |
1949 | 2096 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
178 | 179 | | |
179 | 180 | | |
180 | 181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| 169 | + | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
| |||
Lines changed: 169 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
0 commit comments