diff --git a/home/home.go b/home/home.go index b0db68d9..b35a8a85 100644 --- a/home/home.go +++ b/home/home.go @@ -369,125 +369,13 @@ function fetchW(la,lo){ // rounded textarea with send button inside. if viewerID != "" { b.WriteString(fmt.Sprintf(` -
-
- +
+ + +
`, stream.MaxContentLength)) - } - - // Inline card preferences panel — toggled by the ⚙ icon. - if viewerAcc != nil { - allCardDefs := []struct{ id, label string }{ - {"reminder", "Reminder"}, {"blog", "Blog"}, {"news", "News"}, - {"markets", "Markets"}, {"social", "Social"}, {"video", "Video"}, - } - activeSet := map[string]bool{} - if len(viewerAcc.HomeCards) > 0 { - for _, id := range viewerAcc.HomeCards { - activeSet[id] = true - } - } else { - for _, c := range allCardDefs { - activeSet[c.id] = true - } - } - var checkboxes string - for _, c := range allCardDefs { - checked := "" - if activeSet[c.id] { - checked = " checked" - } - checkboxes += fmt.Sprintf(``, c.id, checked, c.label) - } - b.WriteString(fmt.Sprintf(``, checkboxes)) - } - - // User card preferences — if set, only show cards in the user's - // chosen order. Empty = show all in default order. - var userCards map[string]int // card ID → display order - if viewerAcc != nil && len(viewerAcc.HomeCards) > 0 { - userCards = make(map[string]int, len(viewerAcc.HomeCards)) - for i, id := range viewerAcc.HomeCards { - userCards[id] = i - } - } - - var leftHTML []string - var rightHTML []string - - tooltips := map[string]string{ - "blog": "Microblog posts with daily AI-generated digests", - "news": "Headlines from RSS feeds, sorted by time", - "markets": "Live crypto, futures, and commodity prices", - "reminder": "Daily Islamic reminder with verse and hadith", - "social": "Public discussion threads", - "video": "Latest videos from curated channels", - } - - for _, card := range Cards { - // If user has card preferences, skip cards not in their list. - if userCards != nil { - if _, ok := userCards[card.ID]; !ok { - continue - } - } - content := card.CachedHTML - if strings.TrimSpace(content) == "" { - continue - } - if card.Link != "" { - content += app.Link("More", card.Link) - } - title := card.Title - if tip, ok := tooltips[card.ID]; ok { - title += fmt.Sprintf(` ?`, htmlEsc(tip)) - } - html := fmt.Sprintf(app.CardTemplate, card.ID, card.ID, title, content) - if card.Column == "left" { - leftHTML = append(leftHTML, html) - } else { - rightHTML = append(rightHTML, html) - } - } - - if len(leftHTML) > 0 || len(rightHTML) > 0 { - b.WriteString(fmt.Sprintf(Template, - strings.Join(leftHTML, "\n"), - strings.Join(rightHTML, "\n"))) - } - - b.WriteString(`
`) // close #home-cards - - // Console overlay + script (prompt is now inline above the cards). - if viewerID != "" { - b.WriteString(fmt.Sprintf(` - - -`, stream.MaxContentLength)) b.WriteString(consoleScript) } @@ -565,84 +453,54 @@ func htmlEsc(s string) string { // consoleScript — stateless command prompt. Fixed bottom bar opens a // full-screen overlay. Ask a question, get an answer. Escape closes. // consoleScript — Claude-style inline prompt with overlay for responses. +// consoleScript calls the agent API directly. No stream, no polling, +// no overlay. Question → POST /agent/run → response inline. const consoleScript = `