You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
milestones: typed keys, recorded where the action succeeds, unknown is not "not done"
The once-ever facts behind the "still to try" lines are now a closed
set of typed keys in the store. Every action that earns one is logged
through logChange after it succeeds, so that is where the milestone is
recorded; a saved notification setting marks its own per-person key.
Current state is consulted only as a healing path for accounts that did
things before milestones existed, and the comment says so.
A read that fails while building a card now makes the card unavailable,
with one warning for the render, rather than reading as "never done" and
telling a household to try what it has done.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0121j6qgGwUSLGQ48jWZN98F
{Key: "roster", Label: "Add a number plate to the weekly schedule", Href: "#roster", Done: roster},
62
-
{Key: "booking", Label: "Make a booking for a visitor who does not fit the roster", Href: "/schedule?book=1", Done: did(store.ActionOverrideAdd)},
74
+
{Milestone: store.MilestoneRoster, Label: "Add a number plate to the weekly schedule", Href: "#roster", Done: roster},
75
+
{Milestone: store.MilestoneBooking, Label: "Make a booking for a visitor who does not fit the roster", Href: "/schedule?book=1", Done: did(store.ActionOverrideAdd)},
63
76
}
64
-
ifroster {
65
-
items=append(items, checkItem{Key: "weeks", Label: "Add a second week, if the roster differs week to week", Href: "#roster", Done: weeks})
77
+
ifroster||ms[store.MilestoneRoster] {
78
+
items=append(items, checkItem{Milestone: store.MilestoneWeeks, Label: "Add a second week, if the roster differs week to week", Href: "#roster", Done: weeks})
66
79
}
67
80
case"vehicles":
68
-
vs, _:=s.store.ListVehiclesFor(ctx, owner)
81
+
vs, err:=s.store.ListVehiclesFor(ctx, owner)
82
+
note(err)
69
83
email:=false
70
84
for_, v:=rangevs {
71
85
ifv.Email!="" {
72
86
email=true
73
87
}
74
88
}
75
89
items= []checkItem{
76
-
{Key: "rego", Label: "Save the rego of someone who visits you", Href: "#add", Done: len(vs) >0},
77
-
{Key: "rego-email", Label: "Add an email, so they are told when their rego goes on the permit", Href: "#add", Done: email},
90
+
{Milestone: store.MilestoneRego, Label: "Save the rego of someone who visits you", Href: "#add", Done: len(vs) >0},
91
+
{Milestone: store.MilestoneRegoEmail, Label: "Add an email, so they are told when their rego goes on the permit", Href: "#add", Done: email},
78
92
}
79
93
case"guests":
80
-
// The grant rows outlive the change log (pruned at 90 days, and younger than
81
-
// some accounts), so each line reads the durable row first and the log only
{Key: "visitor-qr", Label: "Show a visitor QR to someone at the door", Href: "#now", Done: shown>0||did(store.ActionDoorQRShow)},
86
-
{Key: "guest-pass", Label: "Send a guest pass to a household that visits often", Href: "#new", Done: passes>0||did(store.ActionGuestCreate)},
87
-
{Key: "printed-qr", Label: "Print a QR that pings your phone when it is used", Href: "#now", Done: printed>0||did(store.ActionDoorQRCreate)},
97
+
{Milestone: store.MilestoneVisitorQR, Label: "Show a visitor QR to someone at the door", Href: "#now", Done: shown>0||did(store.ActionDoorQRShow)},
98
+
{Milestone: store.MilestoneGuestPass, Label: "Send a guest pass to a household that visits often", Href: "#new", Done: passes>0||did(store.ActionGuestCreate)},
99
+
{Milestone: store.MilestonePrintedQR, Label: "Print a QR that pings your phone when it is used", Href: "#now", Done: printed>0||did(store.ActionDoorQRCreate)},
88
100
}
89
101
case"settings":
90
-
permits, _:=s.store.ListPermitsFor(ctx, owner)
102
+
permits, err:=s.store.ListPermitsFor(ctx, owner)
103
+
note(err)
91
104
named:=false
92
105
for_, p:=rangepermits {
93
106
ifp.Label!=""&&p.Label!=p.PermitNumber {
94
107
named=true
95
108
}
96
109
}
97
-
household, _:=s.store.HouseholdName(ctx, owner)
98
-
members, _:=s.store.CountMembers(ctx, owner)
99
-
prefs, _:=s.store.HasNotifyPref(ctx, user)
110
+
prefs, err:=s.store.HasNotifyPref(ctx, user)
111
+
note(err)
100
112
items= []checkItem{
101
-
{Key: "permit-name", Label: "Name the permit, as it appears on the schedule and in your emails", Href: "/schedule", Done: named},
113
+
{Milestone: store.MilestonePermitName, Label: "Name the permit, as it appears on the schedule and in your emails", Href: "/schedule", Done: named},
102
114
}
103
115
ifisPrimary {
116
+
household, err:=s.store.HouseholdName(ctx, owner)
117
+
note(err)
118
+
members, err:=s.store.CountMembers(ctx, owner)
119
+
note(err)
104
120
items=append(items,
105
-
checkItem{Key: "household-name", Label: "Name the household, so visitors see it instead of your email", Href: "#household", Done: household!=""},
106
-
checkItem{Key: "shared", Label: "Give someone else in the house access", Href: "#shared", Done: members>0})
121
+
checkItem{Milestone: store.MilestoneHouseholdName, Label: "Name the household, so visitors see it instead of your email", Href: "#household", Done: household!=""},
122
+
checkItem{Milestone: store.MilestoneShared, Label: "Give someone else in the house access", Href: "#shared", Done: members>0})
107
123
}
108
-
items=append(items, checkItem{Key: "notify:"+user, Label: "Set how you want to be told about changes", Href: "#notifications", Done: prefs})
124
+
items=append(items, checkItem{Milestone: store.MilestoneNotify(user), Label: "Set how you want to be told about changes", Href: "#notifications", Done: prefs})
109
125
default:
110
126
returnnil
111
127
}
128
+
ifreadErr!=nil {
129
+
alog.Warnf("checklist for %s (%s) unavailable: %v", redact.Email(owner), tab, readErr)
130
+
returnnil
131
+
}
112
132
v:=&checklistView{Key: tab, Items: items}
113
133
fori:=rangeitems {
114
-
ifms[items[i].Key] {
134
+
ifms[items[i].Milestone] {
115
135
items[i].Done=true
116
136
} elseifitems[i].Done {
117
-
// Evidence says done and no milestone yet: record it now, while the
118
-
// evidence still exists.
119
-
_=s.store.MarkMilestone(ctx, owner, items[i].Key)
137
+
// Healing: the account did this before milestones were recorded.
0 commit comments