Repository navigation
feat(web): walk an empty repo's owner through the first push in three steps - #650
Merged
Merged
Conversation
… steps The empty-repo page listed push commands with the install link last and the sign-in command buried in prose. Number the steps (install, sign dg in, push), make the sign-in line copyable, and give the from-scratch path a first commit that pushes HEAD to the default branch, since a fresh clone of an empty repo may be on master. Visitors who cannot push are told nothing is there yet instead of being addressed as the pusher. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
PastaPastaPasta
commented
Nov 22, 2026
PastaPastaPasta
left a comment
Owner
Author
There was a problem hiding this comment.
Verdict: approve
I checked the commands against the Rust code and ran the tests on head ba18a1e0:
pnpm exec vitest run components/repo/repo-home-content.test.tsx: 6/6 passpnpm exec tsc --noEmit: cleanlint:copy: clean- CI
playwright (read-only, testnet): b-5 passed (v2-home.spec.ts:202, 2.7s)
npm ci can't run here because there is no package-lock; the repo uses pnpm.
Command correctness (verified)
dg auth login --mnemonic --network …matchesLoginArgs.mnemonic(crates/dg/src/auth/mod.rs:140, used at:843).dg auth newand the global--network/--devnet-nameflags match too (crates/dg/src/main.rs:131-137).dg repo clone owner/name --network …matchesRepoCommand::Clone(main.rs:480). It clones into the repo's name (repo.rs:106) and pins the network afterwards (repo.rs:147), so&& cd <name>and the later push land on the right network.HEAD:<branch>is the right refspec for the from-scratch path. git-remote-dash only emits the@refs/heads/<default> HEADsymref when the default branch exists (crates/git-remote-dash/src/helper.rs:3602). So a clone of an empty repo checks out the user'sinit.defaultBranch, which is oftenmaster. A baregit push -u origin mainwould fail there with "src refspec main does not match any";HEAD:mainworks and-utracksorigin/main.- Quoting: repo names are limited to
^[a-z0-9][a-z0-9._-]{0,62}$(forge-contracts/contracts/forge-core.json:85), soshellWord('# name')always gives a plain single-quoted word.echocan't take it as an option (it starts with#), and no backslash escapes are possible. Branch names with shell metacharacters go throughshellWord, andHEAD:'a;b'is still a single shell word. Safe.
Gating, layout, e2e
- Visitor vs pusher copy keys off
useCanConfigureStorage, and the unit tests cover both cases. The "No storage configured" note stays pusher-only. - Dropping
coarse:mt-6(QW3-060) is fine. The Install link is now in step 1, and the storage paragraph between it and "Configure storage →" has no interactive elements (FiatNote is text only), so the 44px hit areas can't overlap. - Mobile:
CopyRow's<code>ismin-w-0 flex-1 break-all, so the long README/push line wraps inside thepl-9step instead of scrolling the page. - The e2e
codeorder matches the render: authLogin, remoteAdd, setNetwork, push, clone, readme.authNewis aspan, notcode, so it's correctly left out.
Nits (non-blocking)
forge-web/components/repo/repo-home-content.tsx("From a repository you already have",git push -u origin ${branchName}), nit, pre-existing: a user whose existing repo is onmaster(git's default unlessinit.defaultBranchis set) gets "src refspec main does not match any" when the default branch ismain. The from-scratch line now usesHEAD:mainfor exactly this reason, so the two paths disagree. Options:HEAD:${branchName}here too (but that pushes whatever is checked out), or a one-line hint ("on another branch?git push -u origin <yours>:main").- Same file, the
canConfigure ? 'Three steps…' : 'Nothing has been pushed yet…'line, nit:useCanConfigureStorageis false until the viewer's role is read. A signed-in maintainer or writer (not the owner) briefly sees the visitor sentence ("Its members push with these steps…") before it switches. It's cosmetic; you could show the neutral copy only once the role isknown. - Same file, the from-scratch line, nit:
git commitfails on a machine with nouser.name/user.email, which is a common first-push snag for exactly the audience of this screen. You could link the first-push troubleshooting guide (lib/docs/catalog.ts:40) next to step 3.
🤖 Posted autonomously by Claude (claude-opus-5-5) on behalf of pasta.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A new repo's page is the first thing an owner sees after creating it. It listed three push commands and buried the steps that come before them:
dg auth login …) was inside a sentence, with no copy button;dg repo clone, leaving the first commit to the reader.Visitors who can't push were addressed as if they were the pusher.
What changes
git-remote-dashanddgare for, plus the Install link).dg auth login --mnemonic --network …, withdg auth newfor anyone without an identity).echo '# <name>' > README.md && git add README.md && git commit -m 'First commit' && git push -u origin HEAD:<default>. It pushesHEAD:because a fresh clone of an empty repo checks outinit.defaultBranch, which ismasteron stock git. git-remote-dash advertises no HEAD for an empty repo.e2e/v2-home.spec.tsb-5 expects the new command list.Screenshots (testnet)
Phone: before / after. Full after page.
The "before" desktop shot shows a sibling probe repo, so the name differs. The layout is what this PR changes.
How it was tested
components/repo/repo-home-content.test.tsx(6/6), with 2 new tests: the numbered steps, the first-commit line ending inHEAD:main, and the visitor copy.tsc --noEmitis clean.ux4-probe-a, then pushed it withgit remote add,git config dash.network testnetandgit push -u origin mainusing git-remote-dash built from master. It took 25 s and cost about 0.008 DASH.mastervsmainfirst-push trap, which is fixed here.🤖 Generated with Claude Code