carlos / platform Public

console: domain page offers a Point retry when pointing is unfinished

When a bought domain's apex or www is pending, or only one is attached,
the owner sees Point at the app holding the existing address, so the
point door can finish it from the browser. Copy is DRAFT.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 49f90ae7c83f838c6aaa761e3a3026c324c30612 parent 534122b
4 files changed, +113 −2
  • internal/console/accountdomains_copy.go +12 −0
  • internal/console/accountdomainspage.go +30 −1
  • internal/console/accountdomainspage_test.go +70 −0
  • internal/console/templates/account_domain.html +1 −1
diff --git a/internal/console/accountdomains_copy.go b/internal/console/accountdomains_copy.go
index 850a3ecfb..54a968511 100644
--- a/internal/console/accountdomains_copy.go
+++ b/internal/console/accountdomains_copy.go
@@ -187,3 +187,15 @@ var domainAPICopy = struct{ ChooseApp, Unread string }{
ChooseApp: "choose an app to point the domain at, or choose not yet",
Unread: "could not read your domains. try again",
}
+
+// domainPointRetryCopy is a bought domain's page when pointing it at an app
+// is not finished: only one of the apex and www attached, or one still
+// waiting for its proof. The owner points again at the same app.
+// DRAFT (final fix wave, 2026-11-19): not yet through copy review.
+// {domain} and {app} are filled by the page.
+var domainPointRetryCopy = struct {
+ Title, Note string
+}{
+ Title: "Finish pointing",
+ Note: "{domain} is not fully pointed at {app} yet. Point it again to finish.",
+}
diff --git a/internal/console/accountdomainspage.go b/internal/console/accountdomainspage.go
index 917a5fb46..07f1c607a 100644
--- a/internal/console/accountdomainspage.go
+++ b/internal/console/accountdomainspage.go
@@ -108,7 +108,8 @@ type domainPageView struct {
Eyebrow string
Card domainCardView
Tiles []domainTile
- PointApps []domainAppAction // owners, on an unpointed bought domain
+ PointTitle string
+ PointApps []domainAppAction // owners: every app on an unpointed bought domain, or the one app whose pointing is unfinished
PointNote string
Registrant []domainTile // label and value pairs; nil when none is recorded
MoveHint bool // owners, on a bought domain with an address they can detach
@@ -446,8 +447,15 @@ func (s *Server) domainPage(ctx context.Context, acct *Account, owner bool, c do
}
}
if cv.PointHref != "" {
+ v.PointTitle = domainsPageCopy.PointAtApp
v.PointApps = domainAppActions(acct, apps, "point", domainsPageCopy.PointToApp)
v.PointNote = domainsFill(domainsPageCopy.PointNote, "{domain}", c.Domain)
+ } else if app := pointRetryApp(c); owner && ready && !cv.Buying && app != "" && detachableApps(apps)[app] {
+ // Pointing is not finished: the point door, again at the same app,
+ // completes a partial or pending attach.
+ v.PointTitle = domainPointRetryCopy.Title
+ v.PointApps = domainAppActions(acct, []string{app}, "point", domainsPageCopy.PointToApp)
+ v.PointNote = domainsFill(domainPointRetryCopy.Note, "{domain}", c.Domain, "{app}", app)
}
if rc := c.Registration.Registrant; rc.FirstName != "" || rc.LastName != "" || rc.Email != "" {
// The name for everyone; the rest is personal data, owners only, as
@@ -463,6 +471,27 @@ func (s *Server) domainPage(ctx context.Context, acct *Account, owner bool, c do
return v
}
+// pointRetryApp is the app a bought domain's pointing is unfinished at, or
+// "": the apex and www addresses (apps not in Trash) all on one app, with
+// one of the two missing or either still pending. No such address, two
+// apps, or both attached and proven is "".
+func pointRetryApp(c domainCard) string {
+ app, seen, pending := "", 0, false
+ for _, a := range c.Addresses {
+ if a.Host != c.Domain && a.Host != "www."+c.Domain {
+ continue
+ }
+ if a.AppInTrash || app != "" && a.App != app {
+ return ""
+ }
+ app, seen, pending = a.App, seen+1, pending || a.claim.Pending
+ }
+ if app == "" || seen == 2 && !pending {
+ return ""
+ }
+ return app
+}
+
// domainExpiresTile is a bought domain's expiry, with how long is left.
func domainExpiresTile(c domainCardView, now time.Time) domainTile {
t := domainTile{Label: domainsPageCopy.TileExpires, Value: c.ExpiresText, ValueISO: c.ExpiresISO}
diff --git a/internal/console/accountdomainspage_test.go b/internal/console/accountdomainspage_test.go
index f0eaaba23..340ab920d 100644
--- a/internal/console/accountdomainspage_test.go
+++ b/internal/console/accountdomainspage_test.go
@@ -714,3 +714,73 @@ func TestDomainExpiresTileDays(t *testing.T) {
t.Fatalf("one-day words %q / %q", domainsPageCopy.InDayOne, domainsPageCopy.InDaysToday)
}
}
+
+// TestDomainPageOffersPointRetryWhenPartialOrPending: a bought domain whose
+// apex or www is still pending, or with only one of them attached, offers
+// its owner a retry of Point at the app holding the existing address (the
+// point door finishes a partial or pending attach). Not where pointing is
+// complete, not for an app in Trash, never for a member.
+func TestDomainPageOffersPointRetryWhenPartialOrPending(t *testing.T) {
+ f := adPurchaseFixture(t)
+ fx, acct := f.consoleFixture, f.acct
+ base := "/a/" + acct.Sqid
+ if _, err := fx.st.CreateAppIn(acct.ID, "web", "buyer@example.test", time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := fx.st.CreateAppIn(acct.ID, "old", "buyer@example.test", time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ if err := fx.st.TrashAppRow(acct.ID, "old", time.Now()); err != nil {
+ t.Fatal(err)
+ }
+ expires := time.Now().AddDate(1, 0, 0)
+ // partial.com: only the apex attached to kass.
+ adBought(t, fx, acct, "partial.com", expires)
+ adClaim(t, fx, acct, "kass", "partial.com")
+ // pending.com: both on kass, www waiting for its proof.
+ adBought(t, fx, acct, "pending.com", expires)
+ adClaim(t, fx, acct, "kass", "pending.com")
+ adPutClaim(t, fx, domains.Claim{Schema: 1, Host: "www.pending.com", Account: acct.Sqid, App: "kass", Route: "r.kass", Pending: true})
+ // done.com: both on kass, nothing pending.
+ adBought(t, fx, acct, "done.com", expires)
+ adClaim(t, fx, acct, "kass", "done.com")
+ adClaim(t, fx, acct, "kass", "www.done.com")
+ // trashed.com: the apex only, on an app in Trash.
+ adBought(t, fx, acct, "trashed.com", expires)
+ adClaim(t, fx, acct, "old", "trashed.com")
+
+ owner := adSignIn(t, fx, adOwner(acct))
+ for _, d := range []string{"partial.com", "pending.com"} {
+ status, body := adGet(t, fx, owner, acct, "/domains/"+d)
+ if status != http.StatusOK {
+ t.Fatalf("GET %s = %d:\n%s", d, status, body)
+ }
+ main := mainOf(t, body)
+ for _, want := range []string{
+ `<h2 id="point">` + domainPointRetryCopy.Title + `</h2>`,
+ `<input type="hidden" name="domain" value="` + d + `">`,
+ `formaction="` + base + `/apps/kass/domains/point"`,
+ html.EscapeString(domainsFill(domainPointRetryCopy.Note, "{domain}", d, "{app}", "kass")),
+ } {
+ if !strings.Contains(main, want) {
+ t.Errorf("%s: owner's page lacks %q:\n%s", d, want, main)
+ }
+ }
+ if strings.Contains(main, "/apps/web/domains/point") {
+ t.Errorf("%s: the retry offers another app", d)
+ }
+ }
+ for _, d := range []string{"done.com", "trashed.com"} {
+ _, body := adGet(t, fx, owner, acct, "/domains/"+d)
+ if main := mainOf(t, body); strings.Contains(main, "/domains/point") {
+ t.Errorf("%s: owner's page offers Point:\n%s", d, main)
+ }
+ }
+ member := adMember(t, fx, acct)
+ for _, d := range []string{"partial.com", "pending.com"} {
+ _, body := adGet(t, fx, member, acct, "/domains/"+d)
+ if main := mainOf(t, body); strings.Contains(main, "/domains/point") {
+ t.Errorf("%s: member's page offers Point", d)
+ }
+ }
+}
diff --git a/internal/console/templates/account_domain.html b/internal/console/templates/account_domain.html
index 53c71efa7..2d711cfea 100644
--- a/internal/console/templates/account_domain.html
+++ b/internal/console/templates/account_domain.html
@@ -30,7 +30,7 @@
{{end}}
{{if $v.PointApps}}
-<h2 id="point">{{$c.PointAtApp}}</h2>
+<h2 id="point">{{$v.PointTitle}}</h2>
<form method="post" action="{{(index $v.PointApps 0).Action}}" class="settings-row">
<input type="hidden" name="csrf" value="{{$.CSRF}}">
<input type="hidden" name="domain" value="{{$d.Domain}}">