Fixes from the first round of TEST.md

SEO: a domain property (sc-domain:) covers every subdomain, so the shop,
Gitea and forum were counted as the website. What ranks, the morning
check, the Monday report, keywords, change candidates and the audit's
traffic now read only the website's own host (with or without www).
The report keeps pages worth a proposal apart from "Waiting for your
yes", explains only moves past the thresholds, and says "places up/down".

Also:
- Feed summaries drop the posts' scripts and styles.
- Spend you log can't be negative.
- Test and check buttons can't be clicked twice while they run.
- Previews show the site's web fonts and icon sprites.
- Backups are read without leaving -wal/-shm files; deleting one removes
  them, and leftovers are swept at start.
- The Overview's setup flags a CRM that Hermes can't reach.
- Import now says what came in; adding a prospect that exists says so;
  prospects can be deleted.
- Signal tags and brief addresses keep accented letters (Ü → u).
- Page errors start with a capital; clearer messages for bad uploads,
  CRM retry and cancel, keywords, and the finished audit.
- The module you're in stays unfolded in the sidebar.
- A picked keyword can be unpicked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-24 06:31:42 -07:00
co-authored by Claude Opus 5.5
parent 3ddf716e71
commit c36f786ae9
52 changed files with 796 additions and 128 deletions
+19 -8
View File
@@ -24,16 +24,18 @@ type Report struct {
Where string `json:"where"` // where the change came from, in a sentence
Pages []Move `json:"pages"` // the 3 pages that moved most
Waiting []Pick `json:"waiting"`
// Candidates are the pages worth a proposal, when none is waiting.
Candidates []Pick `json:"candidates,omitempty"`
}
// Weekly builds the Monday report for the latest week of final data. The
// "waiting for your yes" list holds at most 3 items.
func Weekly(d *db.DB, site string, now time.Time) (*Report, error) {
c, err := MorningCheck(d, site, Settings{}) // every change, to rank the pages
func Weekly(d *db.DB, sc Scope, now time.Time) (*Report, error) {
c, err := MorningCheck(d, sc, Settings{}) // every change, to rank the pages
if err != nil || c == nil {
return nil, err
}
r := &Report{Site: site, WeekFrom: c.From, WeekTo: c.To, CreatedAt: now, Before: c.Before, After: c.After}
r := &Report{Site: sc.Property, WeekFrom: c.From, WeekTo: c.To, CreatedAt: now, Before: c.Before, After: c.After}
r.Where = where(c.Before, c.After)
var pages []Move
for _, m := range c.Moves {
@@ -59,11 +61,12 @@ func Weekly(d *db.DB, site string, now time.Time) (*Report, error) {
pages = pages[:3]
}
// The causes, from the full check (which explains only real moves).
full, err := MorningCheck(d, site, LoadSettings(d))
full, err := MorningCheck(d, sc, LoadSettings(d))
if err != nil {
return nil, err
}
for i := range pages {
pages[i].Why = []string{"Under the thresholds for a real move: noise until it lasts."}
for _, m := range full.Moves {
if m.Kind == "page" && m.Key == pages[i].Key {
pages[i].Why = m.Why
@@ -73,7 +76,7 @@ func Weekly(d *db.DB, site string, now time.Time) (*Report, error) {
r.Pages = pages
// The changes proposed for the site, or else the pages to push.
rows, err := d.Query(`SELECT `+changeCols+` FROM seo_changes WHERE property = ? AND status = ? ORDER BY id LIMIT ?`,
site, ChangeProposed, MaxWaiting)
sc.Property, ChangeProposed, MaxWaiting)
if err != nil {
return nil, err
}
@@ -91,13 +94,15 @@ func Weekly(d *db.DB, site string, now time.Time) (*Report, error) {
}
r.Waiting = append(r.Waiting, Pick{Page: c.Page, Why: strings.Join(what, " ") + " Why: " + c.Why})
}
// With nothing proposed, the pages worth a proposal, kept apart: they
// aren't waiting for a yes until a change is proposed for them.
if len(r.Waiting) == 0 {
ranks, err := WhatRanks(d, site)
ranks, err := WhatRanks(d, sc)
if err != nil {
return nil, err
}
if ranks != nil {
r.Waiting = ranks.Push
r.Candidates = ranks.Push
}
}
return r, nil
@@ -212,10 +217,16 @@ func (r *Report) Text() string {
}
b.WriteString("\n3. Waiting for your yes\n")
if len(r.Waiting) == 0 {
b.WriteString(" Nothing this week.\n")
b.WriteString(" Nothing is waiting: no change has been proposed.\n")
}
for i, p := range r.Waiting {
fmt.Fprintf(&b, " %d. %s\n %s\n", i+1, p.Page, p.Why)
}
if len(r.Candidates) > 0 {
b.WriteString("\n Worth a proposal (Propose changes, on SEO → Changes):\n")
for _, p := range r.Candidates {
fmt.Fprintf(&b, " - %s\n %s\n", p.Page, p.Why)
}
}
return b.String()
}