Public: anyone can read this; the crew can change it.

The signed-in home speaks the public home page's language, with looks before and after #9610

Parked opened this
Closed without merging

scout/forge:scout/9584-the-signed-in-home-speaks-the-public-hom → main 2 commits fork

  • Closed without merging. Nothing was applied to main.

Review

Sign in to review this change.
2 files changed +30 −10
src/web/studio/living.ts +14 −10
@@ -14,7 +14,7 @@ import type { User } from "../../core/users.ts";
1414 import type { Ctx } from "../../http/context.ts";
1515 import { html, type Html } from "../html.ts";
1616 import { fragment } from "../layout.ts";
17 import { btn, listCard, row, timeAgo } from "../ui.ts";
17 import { btn, row, timeAgo } from "../ui.ts";
1818 import { notePhase, takeSessionTime, timePhase } from "../../core/route_timing.ts";
1919 import type { NowStage } from "../../flow/now_rows.ts";
2020 import { nowHref } from "../pages/now.ts";
@@ -67,7 +67,9 @@ function listOf(label: string, rows: readonly MovingRow[], empty: string): Html
6767 shown.push(row({ title: html`<span class="muted small">${i === 0 ? empty : " "}</span>` }));
6868 return html`<section aria-label="${label}">
6969 <h2 class="small muted">${label}</h2>
70 ${listCard(shown)}
70 <ul class="list">
71 ${shown}
72 </ul>
7173 </section>`;
7274 }
7375
@@ -114,9 +116,11 @@ export function tellBox(ctx: Ctx, user: User): Html {
114116 <option value="${FORGE_TARGET}">the forge</option>
115117 </select>`}
116118 ${btn("Tell", { variant: "primary" })}
117 ${btn("Notes", { href: "/notes", icon: "comment", title: "Your notes and where they stand" })}
118 ${btn("Talk", { href: "/talk", icon: "comment", title: "Talk to the forge" })}
119 </form>`;
119 </form>
120 <p class="small muted">
121 <a href="/notes" title="Your notes and where they stand">Notes</a> ·
122 <a href="/talk" title="Talk to the forge">Talk</a>
123 </p>`;
120124 }
121125
122126 /** Your apps as chips, each a link to the app, and a plus for a new one. */
@@ -124,11 +128,11 @@ export function appChips(ctx: Ctx, user: User): Html {
124128 const { repos } = writableAppsOf(ctx, user);
125129 return html`<section aria-label="Your apps" id="live-chips" data-live="app.serving,app.stopped,app.created,app.deleted" data-live-src="/live/chips">
126130 <h2 class="small muted">Your apps</h2>
127 <div class="bar">
128 ${repos.slice(0, 12).map((r) => btn(r.name, { href: repoBase(r), size: "sm" }))}
129 ${btn("New app", { href: "/apps/new", size: "sm", icon: "plus" })}
130 ${repos.length > 12 ? btn(`All ${repos.length}`, { href: "/apps", size: "sm" }) : null}
131 </div>
131 <p class="bar small">
132 ${repos.slice(0, 12).map((r) => html`<a href="${repoBase(r)}">${r.name}</a>`)}
133 <a href="/apps/new">New app</a>
134 ${repos.length > 12 ? html`<a href="/apps">All ${repos.length}</a>` : null}
135 </p>
132136 </section>`;
133137 }
134138
test/home-living.test.ts +16
@@ -215,4 +215,20 @@ describe("the feed page", () => {
215215 const stranger = await get("/feed");
216216 expect(stranger.status).not.toBe(200);
217217 });
218
219 test("the home speaks in rows and plain links, not boxes and button strips (#9584)", async () => {
220 const page = await home(aliceCookie);
221 // The tell box has one button; Notes and Talk are muted links.
222 const form = /<form id="tell-box"[\s\S]*?<\/form>/.exec(page)![0];
223 expect(form).not.toContain('href="/notes"');
224 expect(page).toMatch(/<p class="small muted">\s*<a href="\/notes"[^>]*>Notes<\/a>/);
225 // Your apps are links, not chips with buttons.
226 const apps = /<section aria-label="Your apps"[\s\S]*?<\/section>/.exec(page)![0];
227 expect(apps).not.toContain('class="btn');
228 expect(apps).toContain('href="/apps/new"');
229 // The moving lists are rows, not a card.
230 const moving = /<section aria-label="Being built">[\s\S]*?<\/section>/.exec(page)![0];
231 expect(moving).toContain('<ul class="list">');
232 expect(moving).not.toContain('class="card');
233 });
218234 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs