Skip to content

feat(web): walk an empty repo's owner through the first push in three steps - #650

Merged
PastaPastaPasta merged 2 commits into
masterfrom
ux/empty-repo-steps
Nov 22, 2026
Merged

PastaPastaPasta merged 2 commits into
masterfrom
ux/empty-repo-steps

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

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:

  • the install link sat at the bottom, under the storage costs;
  • the sign-in command (dg auth login …) was inside a sentence, with no copy button;
  • "start from scratch" stopped at 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

  • Three numbered steps:
    1. Install the Dash git tools (what git-remote-dash and dg are for, plus the Install link).
    2. Sign in on this computer (a copyable dg auth login --mnemonic --network …, with dg auth new for anyone without an identity).
    3. Push your code (from an existing repo, or from scratch).
  • The from-scratch path now ends in a first push: echo '# <name>' > README.md && git add README.md && git commit -m 'First commit' && git push -u origin HEAD:<default>. It pushes HEAD: because a fresh clone of an empty repo checks out init.defaultBranch, which is master on stock git. git-remote-dash advertises no HEAD for an empty repo.
  • Visitors see "Nothing has been pushed yet. Its members push with these steps…" instead of "Three steps to your first push."
  • The storage and cost line and the "No storage configured" note stay, under a divider.
  • e2e/v2-home.spec.ts b-5 expects the new command list.

Screenshots (testnet)

Before After

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 in HEAD:main, and the visitor copy.
  • tsc --noEmit is clean.
  • Live on testnet: I created ux4-probe-a, then pushed it with git remote add, git config dash.network testnet and git push -u origin main using git-remote-dash built from master. It took 25 s and cost about 0.008 DASH.
  • An independent review caught the master vs main first-push trap, which is fixed here.

🤖 Generated with Claude Code

PastaPastaPasta and others added 2 commits November 22, 2026 03:04
… 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]>
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a6ef5ec5-ebb4-4be5-8977-98a8bdc7e6db
Commits

Reviewing files that changed from the base of the PR and between f4e15b2 and ba18a1e.

Files selected for processing: 3

  • forge-web/components/repo/repo-home-content.test.tsx
  • forge-web/components/repo/repo-home-content.tsx
  • forge-web/e2e/v2-home.spec.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@PastaPastaPasta PastaPastaPasta left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 pass
  • pnpm exec tsc --noEmit: clean
  • lint: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 … matches LoginArgs.mnemonic (crates/dg/src/auth/mod.rs:140, used at :843). dg auth new and the global --network / --devnet-name flags match too (crates/dg/src/main.rs:131-137).
  • dg repo clone owner/name --network … matches RepoCommand::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> HEAD symref when the default branch exists (crates/git-remote-dash/src/helper.rs:3602). So a clone of an empty repo checks out the user's init.defaultBranch, which is often master. A bare git push -u origin main would fail there with "src refspec main does not match any"; HEAD:main works and -u tracks origin/main.
  • Quoting: repo names are limited to ^[a-z0-9][a-z0-9._-]{0,62}$ (forge-contracts/contracts/forge-core.json:85), so shellWord('# name') always gives a plain single-quoted word. echo can't take it as an option (it starts with #), and no backslash escapes are possible. Branch names with shell metacharacters go through shellWord, and HEAD:'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> is min-w-0 flex-1 break-all, so the long README/push line wraps inside the pl-9 step instead of scrolling the page.
  • The e2e code order matches the render: authLogin, remoteAdd, setNetwork, push, clone, readme. authNew is a span, not code, so it's correctly left out.

Nits (non-blocking)

  1. 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 on master (git's default unless init.defaultBranch is set) gets "src refspec main does not match any" when the default branch is main. The from-scratch line now uses HEAD:main for 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").
  2. Same file, the canConfigure ? 'Three steps…' : 'Nothing has been pushed yet…' line, nit: useCanConfigureStorage is 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 is known.
  3. Same file, the from-scratch line, nit: git commit fails on a machine with no user.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.

@PastaPastaPasta
PastaPastaPasta merged commit 30cd475 into master Nov 22, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant