Public: anyone can read this; the crew can change it.
The owner's home shows no asks; the planner's decline moves to /board and the asks page (test updated on purpose) #2782
scout/forge:scout/2764-the-owner-s-home-shows-no-asks-the-plann → main 2 commits fork
20 files
changed +116
−112
README.md +5 −3
| @@ -566,11 +566,11 @@ my machine", and the dashboard grows an **On your machine** card listing them. | ||
| 566 | 566 | The server remembers only the choice — nothing about the state of a laptop — |
| 567 | 567 | and `forge sync` below is what acts on it. |
| 568 | 568 | |
| 569 | **What an ask row waits for.** Every ask row carries one word, `waitingFor` (`src/core/waiting_for.ts`, computed once), and who it waits on, e.g. "ready to land · on you". The first that applies wins: `conflicts with main` (the last sweep found files stopping the pull, on its author), `ready to land` (a green change to look at and ship), `a review` (a review or a hand-over), `assigned to you` (the pull or issue is assigned to the viewer), otherwise `a decision`. It shows as a chip on each row of the home, as `waitingFor: {word, on}` in `GET /api/v1/asks` and the MCP `asks` tool, and in the terminal's On you card. A grouped row shares one word (the weightiest of its items), and the terminal's card shows its row's word. | |
| 569 | **What an ask row waits for.** Every ask row carries one word, `waitingFor` (`src/core/waiting_for.ts`, computed once), and who it waits on, e.g. "ready to land · on you". The first that applies wins: `conflicts with main` (the last sweep found files stopping the pull, on its author), `ready to land` (a green change to look at and ship), `a review` (a review or a hand-over), `assigned to you` (the pull or issue is assigned to the viewer), otherwise `a decision`. It shows as a chip on each row of the asks page, as `waitingFor: {word, on}` in `GET /api/v1/asks` and the MCP `asks` tool, and in the terminal's On you card. A grouped row shares one word (the weightiest of its items), and the terminal's card shows its row's word. | |
| 570 | 570 | |
| 571 | **Muting a repository from the home**: each ask row on the home carries a "Mute owner/name" chip. A muted repository's asks leave the home, `/api/v1/asks`, the header count and the phone's pushes (the same per-user mute the On you card uses, no new table); the home says "N muted repositories still ask" with a "Listen again" button, and an app's own page still counts them. | |
| 571 | **Muting a repository from the asks page**: each ask row on `/asks` carries a "Mute owner/name" chip. A muted repository's asks leave the asks page, `/api/v1/asks`, the header count and the phone's pushes (the same per-user mute the On you card uses, no new table); the page says "N muted repositories still ask" with a "Listen again" button, and an app's own page still counts them. | |
| 572 | 572 | |
| 573 | **A wave proposal is one card.** With "plans need a nod" on, a plan the planner writes is kept as a proposal and opens nothing. It is one row in the asks list (home, `/asks`, `/api/v1/asks`, MCP `asks`, the terminal's On you card) with its title, its why and its issue titles, all escaped, and it asks the app's owner only. Three taps, each one POST that leaves you on the page you were on: **Approve** opens the issues with their links, exactly as an unheld plan would; **Redirect** takes a text box and hands your words to the planner as a new run on the direction issue; **Later** hides it until you bring it back, from the "N waves put aside" line under the asks (each with a "Bring back" button). A proposal is decided once. The same four verbs (`approve`, `redirect`, `later`, `again`) are on every door, all calling `actions/proposals.ts`: the page (`/asks/proposal/<id>/<verb>`), the API (`POST /api/v1/asks/proposal/<id>/<verb>`, a `rw` token, `{"words": …}` for redirect), the MCP tool `asks_proposal` (`id`, `verb`, `words`), and in the terminal `y` approve, `R` redirect, `l` later and `B` bring every put-aside wave back, on a wave row of the On you card. | |
| 573 | **A wave proposal is one card.** With "plans need a nod" on, a plan the planner writes is kept as a proposal and opens nothing. It is one row in the asks list (`/asks`, `/api/v1/asks`, MCP `asks`, the terminal's On you card) with its title, its why and its issue titles, all escaped, and it asks the app's owner only. Three taps, each one POST that leaves you on the page you were on: **Approve** opens the issues with their links, exactly as an unheld plan would; **Redirect** takes a text box and hands your words to the planner as a new run on the direction issue; **Later** hides it until you bring it back, from the "N waves put aside" line under the asks (each with a "Bring back" button). A proposal is decided once. The same four verbs (`approve`, `redirect`, `later`, `again`) are on every door, all calling `actions/proposals.ts`: the page (`/asks/proposal/<id>/<verb>`), the API (`POST /api/v1/asks/proposal/<id>/<verb>`, a `rw` token, `{"words": …}` for redirect), the MCP tool `asks_proposal` (`id`, `verb`, `words`), and in the terminal `y` approve, `R` redirect, `l` later and `B` bring every put-aside wave back, on a wave row of the On you card. | |
| 574 | 574 | |
| 575 | 575 | **Chips on the feed**: kind chips switch a kind of post off: `reviews` (pulls), `decisions` (decisions and choose decks), `crew` (tells, replies, looks) and `releases`; a person chip switches one person or agent off. Saved per user, one filter (`chipHides`) behind the home feed, `/api/v1/feed`, the Asks list and the terminal's inbox, and the MCP `feed` and `asks` tools, which also take `hide_kinds` and `hide_people` to replace the saved filter for that one call (`[]` lifts it). `/live/apps` (your apps) is not feed items, so chips do not apply there. `GET /api/v1/feed/chips` answers `{kinds, people}`; `POST /api/v1/feed/chips` takes `{"kind": "kind"|"person", "value": "reviews"|"<username>", "hidden": true|false}` (scope `rw`, same-origin). In the terminal dashboard `1`–`4` switch the kind chips `h` on an On you row switches its author off (not your own) and the author's rows leave the card, and `P` brings every person back. The `feed_chips` tool reads them (no arguments, any token) and switches one (`kind`, `value`, `hidden`; an `rw` token). |
| 576 | 576 | |
| @@ -1634,3 +1634,5 @@ operator. (The three guards of migrations 62, 70 and 81 predate the prefix and | ||
| 1634 | 1634 | are known by name in `src/http/refusal.ts`.) The terminal's toasts follow the |
| 1635 | 1635 | same rule. A guard installed by hand without the prefix answers `refused` |
| 1636 | 1636 | until it is re-created with `forge: ` in front of its message. |
| 1637 | ||
| 1638 | **The home shows no asks.** What needs you lives on its own page, `/asks` (a plain "Asks" link in the top bar, no count badge, and a line in the user menu). The signed-in home is the composer, the feed and your apps; it renders no for-you list, count or ask. A bulk step's preview and receipt, Undo, mute and decide all land on `/asks`. |
src/http/server.ts +1 −1
| @@ -254,6 +254,7 @@ import { | ||
| 254 | 254 | asksListen, |
| 255 | 255 | asksMute, |
| 256 | 256 | asksPage, |
| 257 | liveOnYouFragment, | |
| 257 | 258 | } from "../web/studio/asks_page.ts"; |
| 258 | 259 | import { homeArchive, homeArchived, homeArchiveUndo } from "../web/studio/home_archive.ts"; |
| 259 | 260 | import { liveFeedFragment } from "../web/studio/feed.ts"; |
| @@ -266,7 +267,6 @@ import { | ||
| 266 | 267 | import { |
| 267 | 268 | frontUpdate, |
| 268 | 269 | liveAppsFragment, |
| 269 | liveOnYouFragment, | |
| 270 | 270 | studioDoor, |
| 271 | 271 | } from "../web/studio/home.ts"; |
| 272 | 272 | import { appAnswersFragment } from "../web/studio/answers.ts"; |
src/web/layout.ts +3 −2
| @@ -8,7 +8,6 @@ | ||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | import { protectionNotice } from "../kernel/protection.ts"; |
| 11 | import { askCountFor } from "./studio/asks.ts"; | |
| 12 | 11 | import { appsForRepos } from "../core/apps.ts"; |
| 13 | 12 | import { listReposVisibleTo } from "../core/repos.ts"; |
| 14 | 13 | import type { User } from "../core/users.ts"; |
| @@ -215,6 +214,7 @@ function userMenu( | ||
| 215 | 214 | { label: "Your profile", href: `/${user.username}`, icon: "user" }, |
| 216 | 215 | { label: "Your repositories", href: "/", icon: "repo" }, |
| 217 | 216 | { label: "Apps", href: "/apps", icon: "rocket" }, |
| 217 | { label: "Asks", href: "/asks", icon: "alert" }, | |
| 218 | 218 | { label: "Explore", href: "/explore", icon: "search" }, |
| 219 | 219 | { label: "Map", href: "/map", icon: "map" }, |
| 220 | 220 | { separator: true, label: "" }, |
| @@ -464,7 +464,8 @@ function topbar( | ||
| 464 | 464 | <span class="topbar-tools"> |
| 465 | 465 | ${searchBar()} |
| 466 | 466 | ${user |
| 467 | ? html`<span class="hide-sm">${newMenu(ctx)}</span>${userMenu( | |
| 467 | ? html`<a class="btn hide-sm" data-size="sm" href="/asks">Asks</a | |
| 468 | ><span class="hide-sm">${newMenu(ctx)}</span>${userMenu( | |
| 468 | 469 | ctx, |
| 469 | 470 | user, |
| 470 | 471 | theme, |
src/web/pages/board.ts +2 −2
| @@ -394,7 +394,7 @@ function reviewStrip(ctx: Ctx, scope: BoardScope): Html | null { | ||
| 394 | 394 | if (!none && waits.length === 0) return []; |
| 395 | 395 | const oldest = waits.map((w) => w.since).sort()[0]; |
| 396 | 396 | return [ |
| 397 | html`<a class="board-asks" href="/#needs-you" | |
| 397 | html`<a class="board-asks" href="/asks" | |
| 398 | 398 | ><b>${repo.name}</b>: ${none ? "No reviewer: agent pulls wait for you" : "agent pulls wait for your review"}${waits.length === 0 |
| 399 | 399 | ? null |
| 400 | 400 | : html` · <b>${waits.length}</b> waiting since ${oldest!.slice(0, 10)}`}</a |
| @@ -421,7 +421,7 @@ function asksStrip(ctx: Ctx): Html | null { | ||
| 421 | 421 | const since = new Date(Date.now() - ASKS_WINDOW_DAYS * 86_400_000).toISOString(); |
| 422 | 422 | const m = askMeasure(ctx.app.db, user.id, since); |
| 423 | 423 | if (m.raised + m.acted + m.dismissed + m.expired === 0) return null; |
| 424 | return html`<a class="board-asks" id="asks-measure" href="/#needs-you" | |
| 424 | return html`<a class="board-asks" id="asks-measure" href="/asks" | |
| 425 | 425 | >Asks, ${ASKS_WINDOW_DAYS} days: <b>${m.raised}</b> raised · <b>${m.acted}</b> acted |
| 426 | 426 | on · <b>${m.dismissed}</b> dismissed · <b>${m.expired}</b> went by themselves</a |
| 427 | 427 | >`; |
src/web/pages/site.ts +1 −2
| @@ -24,7 +24,6 @@ import { hasAnyUser, verifyPasswordThrottled, type User } from "../../core/users | ||
| 24 | 24 | import { isThemeName } from "../../design/themes.ts"; |
| 25 | 25 | import { cookieValue, crossOrigin, type Ctx } from "../../http/context.ts"; |
| 26 | 26 | import { studioDoor, studioHome } from "../studio/home.ts"; |
| 27 | import { homeTop } from "../studio/asks_page.ts"; | |
| 28 | 27 | import { edgeLoginUrl } from "../../http/edge.ts"; |
| 29 | 28 | import { sshCommand } from "../../ssh/command.ts"; |
| 30 | 29 | import { hostOf, pageHead, signInFirst } from "../chrome.ts"; |
| @@ -208,7 +207,7 @@ export function terminalCard(ctx: Ctx): Html { | ||
| 208 | 207 | export async function home(ctx: Ctx): Promise<Response> { |
| 209 | 208 | const user = ctx.auth.user; |
| 210 | 209 | if (user === undefined) return studioDoor(ctx); |
| 211 | return await studioHome(ctx, user, homeTop(ctx)); | |
| 210 | return await studioHome(ctx, user); | |
| 212 | 211 | } |
| 213 | 212 | |
| 214 | 213 | // ---- authentication ---- |
src/web/studio/asks_page.ts +50 −27
| @@ -1,10 +1,10 @@ | ||
| 1 | 1 | /** |
| 2 | * What needs you, pinned at the top of the home (#634): a sentence — *N | |
| 2 | * What needs you, on its own page (`/asks`; #634 pinned it to the home, which the owner asked to be rid of): a sentence — *N | |
| 3 | 3 | * things need you* — and under it the decision cards (`asks.ts`), then, for |
| 4 | 4 | * a site admin, one card per thing the forge itself needs. Every button is a |
| 5 | 5 | * plain form post. Many asks at once stay here too: tick them, pick one |
| 6 | 6 | * action, and the preview, the receipt and its Undo appear on top |
| 7 | * (`actions/asks_bulk.ts`). `/asks` was its own screen; it lands here now. | |
| 7 | * (`actions/asks_bulk.ts`). It is the page at `/asks`; the home shows none of it. | |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | import type { WaitingFor } from "../../core/waiting_for.ts"; |
| @@ -27,7 +27,6 @@ import { needLine } from "../../actions/health.ts"; | ||
| 27 | 27 | import type { Degraded } from "../../kernel/vitals.ts"; |
| 28 | 28 | import type { Ctx } from "../../http/context.ts"; |
| 29 | 29 | import type { User } from "../../core/users.ts"; |
| 30 | import { onYouAnswer, studioHome } from "./home.ts"; | |
| 31 | 30 | import { notFoundPage, repoBase, signInFirst } from "../chrome.ts"; |
| 32 | 31 | import { backTo, field, readForm } from "../form.ts"; |
| 33 | 32 | import { MAX_BODY } from "../../core/issues.ts"; |
| @@ -40,7 +39,9 @@ import { | ||
| 40 | 39 | ownerFactRepoIds, |
| 41 | 40 | } from "../../core/repos.ts"; |
| 42 | 41 | import { html, type Html } from "../html.ts"; |
| 43 | import { redirect } from "../layout.ts"; | |
| 42 | import { fragment, page, redirect } from "../layout.ts"; | |
| 43 | import { liveRegionsJs } from "../client.ts"; | |
| 44 | import { liveClientJs } from "../live.ts"; | |
| 44 | 45 | import { btn, card, icon, row } from "../ui.ts"; |
| 45 | 46 | import { |
| 46 | 47 | askAnchor, |
| @@ -332,19 +333,36 @@ export interface AsksTop { | ||
| 332 | 333 | readonly reason?: string; |
| 333 | 334 | } |
| 334 | 335 | |
| 335 | /** GET /asks — the home, scrolled to what needs you; `?op=<id>` (a bulk | |
| 336 | * action's receipt) rides along. */ | |
| 337 | export function asksPage(ctx: Ctx): Response { | |
| 338 | const op = ctx.url.searchParams.get("op"); | |
| 339 | return redirect( | |
| 340 | op === null | |
| 341 | ? "/#needs-you" | |
| 342 | : `/?op=${encodeURIComponent(op)}#asks-bulk-result`, | |
| 343 | ); | |
| 336 | /** GET /asks — what needs you; `?op=<id>` (a bulk action's receipt) and | |
| 337 | * `?decided=<id>` ride along. A stranger is sent to sign in. */ | |
| 338 | export async function asksPage(ctx: Ctx): Promise<Response> { | |
| 339 | return await asksScreen(ctx, asksTop(ctx)); | |
| 344 | 340 | } |
| 345 | 341 | |
| 346 | /** The receipt `?op=<id>` names on the home, when it is the viewer's own. */ | |
| 347 | export function homeTop(ctx: Ctx): AsksTop | undefined { | |
| 342 | /** The events that can change what is on you. */ | |
| 343 | const ON_YOU_LIVE = | |
| 344 | "issue.assigned,pull.assigned,issue.closed,pull.closed,issue.reopened,pull.reopened,pull.merged,fleet.operated"; | |
| 345 | ||
| 346 | const onYouRegion = (ctx: Ctx, user: User, note?: string, section: Html = needsYouSection(ctx, user).body): Html => | |
| 347 | html`<div id="live-on-you" data-live="${ON_YOU_LIVE}" data-live-src="/live/on-you"> | |
| 348 | ${note === undefined ? null : html`<p class="small" role="status">${note}</p>`} | |
| 349 | ${section} | |
| 350 | </div>`; | |
| 351 | ||
| 352 | /** What a bulk step answers its own script with: the region as it is now. */ | |
| 353 | function onYouAnswer(ctx: Ctx, user: User, note?: string): Response { | |
| 354 | return fragment(html`<div>${onYouRegion(ctx, user, note)}</div>`); | |
| 355 | } | |
| 356 | ||
| 357 | // GET /live/on-you — what is on the viewer, alone. | |
| 358 | export function liveOnYouFragment(ctx: Ctx): Response { | |
| 359 | const user = ctx.auth.user; | |
| 360 | if (!user) return fragment(html``, { status: 404 }); | |
| 361 | return fragment(onYouRegion(ctx, user), { request: ctx.request }); | |
| 362 | } | |
| 363 | ||
| 364 | /** The receipt `?op=<id>` names, when it is the viewer's own. */ | |
| 365 | function asksTop(ctx: Ctx): AsksTop | undefined { | |
| 348 | 366 | const decided = ctx.url.searchParams.get("decided"); |
| 349 | 367 | if (decided !== null) return handedTop(ctx, decided); |
| 350 | 368 | const op = ctx.url.searchParams.get("op"); |
| @@ -487,12 +505,17 @@ export function needsYouSection( | ||
| 487 | 505 | return { body, scriptJs: SELECT_JS }; |
| 488 | 506 | } |
| 489 | 507 | |
| 490 | /** The home with a bulk step's preview or receipt on top of what needs | |
| 491 | * you — where every bulk answer lands. */ | |
| 492 | async function asksScreen(ctx: Ctx, top: AsksTop): Promise<Response> { | |
| 508 | /** The asks page, with a bulk step's preview or receipt on top of what needs you. */ | |
| 509 | async function asksScreen(ctx: Ctx, top?: AsksTop): Promise<Response> { | |
| 493 | 510 | const user = ctx.auth.user; |
| 494 | 511 | if (!user) return signInFirst(ctx); |
| 495 | return await studioHome(ctx, user, top); | |
| 512 | const needsYou = needsYouSection(ctx, user, top); | |
| 513 | return page({ | |
| 514 | ctx, | |
| 515 | title: "Asks", | |
| 516 | body: html`<h1 class="sr-only">Asks</h1>${onYouRegion(ctx, user, undefined, needsYou.body)}`, | |
| 517 | scriptJs: `${liveClientJs}\n${liveRegionsJs}\n${needsYou.scriptJs}`, | |
| 518 | }); | |
| 496 | 519 | } |
| 497 | 520 | |
| 498 | 521 | // ---- many at once: select, preview, do it, undo — all on this screen ---- |
| @@ -641,7 +664,7 @@ export async function asksBulkSubmit(ctx: Ctx): Promise<Response> { | ||
| 641 | 664 | : `${why.length} not done: ${[...new Set(why.filter((w) => w !== ""))].join("; ") || "refused"}`; |
| 642 | 665 | return onYouAnswer(ctx, ctx.auth.user, note); |
| 643 | 666 | } |
| 644 | return redirect(`/?op=${op.value.id}#asks-bulk-result`); | |
| 667 | return redirect(`/asks?op=${op.value.id}#asks-bulk-result`); | |
| 645 | 668 | } |
| 646 | 669 | const plan = previewAsksBulk(ctx.app, ctx.auth.user, action, items, reason); |
| 647 | 670 | if (!plan.ok) return await asksScreen(ctx, nothingDone(plan.error.message)); |
| @@ -675,7 +698,7 @@ export async function asksBulkUndo(ctx: Ctx): Promise<Response> { | ||
| 675 | 698 | return op.error.code === "not_found" |
| 676 | 699 | ? notFoundPage(ctx) |
| 677 | 700 | : await asksScreen(ctx, nothingDone(op.error.message)); |
| 678 | return redirect(`/?op=${op.value.id}#asks-bulk-result`); | |
| 701 | return redirect(`/asks?op=${op.value.id}#asks-bulk-result`); | |
| 679 | 702 | } |
| 680 | 703 | |
| 681 | 704 | /** POST /asks/decide — hand one hand-over card to the decider; the ledger keeps what it saw. */ |
| @@ -685,7 +708,7 @@ export async function asksDecide(ctx: Ctx): Promise<Response> { | ||
| 685 | 708 | if (form instanceof Response) return form; |
| 686 | 709 | const done = await decideAsk(ctx.app, ctx.auth.user, field(form, "ask")); |
| 687 | 710 | if (!done.ok) return await asksScreen(ctx, nothingDone(done.error.message)); |
| 688 | return redirect(`/?decided=${done.value.id}#asks-bulk-result`); | |
| 711 | return redirect(`/asks?decided=${done.value.id}#asks-bulk-result`); | |
| 689 | 712 | } |
| 690 | 713 | |
| 691 | 714 | /** POST /asks/proposal/:id/(approve|redirect|later|again) — one wave proposal, then back to the page the person came from. */ |
| @@ -701,7 +724,7 @@ export function asksProposal(verb: ProposalVerb) { | ||
| 701 | 724 | : done.error.code === "forbidden" || done.error.code === "unauthorized" |
| 702 | 725 | ? new Response("forbidden", { status: 403 }) |
| 703 | 726 | : await asksScreen(ctx, nothingDone(done.error.message)); |
| 704 | return redirect(backTo(form, "/")); | |
| 727 | return redirect(backTo(form, "/asks")); | |
| 705 | 728 | }; |
| 706 | 729 | } |
| 707 | 730 | |
| @@ -719,7 +742,7 @@ export async function asksSetting(ctx: Ctx): Promise<Response> { | ||
| 719 | 742 | }; |
| 720 | 743 | return await asksScreen(ctx, nothingDone(why[done.error] ?? "it no longer asks you")); |
| 721 | 744 | } |
| 722 | return redirect("/"); | |
| 745 | return redirect("/asks"); | |
| 723 | 746 | } |
| 724 | 747 | |
| 725 | 748 | /** POST /asks/decide/:id/undo — put a set-aside card back on the board, within a day. */ |
| @@ -732,7 +755,7 @@ export async function asksDecideUndo(ctx: Ctx): Promise<Response> { | ||
| 732 | 755 | return undone.error.code === "not_found" |
| 733 | 756 | ? notFoundPage(ctx) |
| 734 | 757 | : await asksScreen(ctx, nothingDone(undone.error.message)); |
| 735 | return redirect(`/?decided=${undone.value.id}#asks-bulk-result`); | |
| 758 | return redirect(`/asks?decided=${undone.value.id}#asks-bulk-result`); | |
| 736 | 759 | } |
| 737 | 760 | |
| 738 | 761 | /** POST /asks/listen — take back the viewer's own mute of the repositories named. */ |
| @@ -745,7 +768,7 @@ export async function asksListen(ctx: Ctx): Promise<Response> { | ||
| 745 | 768 | .filter((r): r is string => typeof r === "string" && /^[A-Za-z0-9_-]{1,64}$/.test(r)) |
| 746 | 769 | .slice(0, BULK_MAX); |
| 747 | 770 | removeMutes(ctx.app.db, ctx.auth.user.id, repos.map((r) => `repo:${r}`)); |
| 748 | return redirect("/"); | |
| 771 | return redirect("/asks"); | |
| 749 | 772 | } |
| 750 | 773 | |
| 751 | 774 | /** POST /asks/mute — the viewer mutes one repository they can read: its asks leave their home, inbox and phone. */ |
| @@ -759,5 +782,5 @@ export async function asksMute(ctx: Ctx): Promise<Response> { | ||
| 759 | 782 | const repo = getRepoById(ctx.app.db, id); |
| 760 | 783 | if (!repo || !canRead(ctx.app.db, repo, ctx.auth.user)) return notFoundPage(ctx); |
| 761 | 784 | muteRepo(ctx.app.db, ctx.auth.user.id, repo.id); |
| 762 | return redirect("/"); | |
| 785 | return redirect("/asks"); | |
| 763 | 786 | } |
src/web/studio/home.ts +3 −39
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | /** |
| 2 | 2 | * The home in the studio: signed in, the feed — the composer, then one |
| 3 | * timeline — with your apps and what is on you beside it (#599). Built from | |
| 3 | * timeline — with your apps beside it (#599). Built from | |
| 4 | 4 | * the same cards as the rest of the forge, from grouped reads only, so the |
| 5 | 5 | * page does not get slower as the apps grow. A stranger gets the door instead: the forge featured, then the |
| 6 | 6 | * best of what is public (`actions/front.ts`). |
| @@ -45,7 +45,6 @@ import { | ||
| 45 | 45 | terminalCard, |
| 46 | 46 | } from "../pages/site.ts"; |
| 47 | 47 | import { writableAppsOf } from "./asks.ts"; |
| 48 | import { needsYouSection, type AsksTop } from "./asks_page.ts"; | |
| 49 | 48 | import { flowCards } from "./flow_card.ts"; |
| 50 | 49 | import { composer, feedJs, feedNote, feedRegion } from "./feed.ts"; |
| 51 | 50 | import { homeTabs } from "./home_tabs.ts"; |
| @@ -56,9 +55,6 @@ import { spawnedOrg } from "../../spawn/claim.ts"; | ||
| 56 | 55 | import { clientApps } from "./client_home.ts"; |
| 57 | 56 | import { passkeyJs } from "../passkey-client.ts"; |
| 58 | 57 | |
| 59 | /** The events that can change what is on you. */ | |
| 60 | const ON_YOU_LIVE = | |
| 61 | "issue.assigned,pull.assigned,issue.closed,pull.closed,issue.reopened,pull.reopened,pull.merged,fleet.operated"; | |
| 62 | 58 | /** The events that can change how an app on the rail is. */ |
| 63 | 59 | const APPS_LIVE = "app.serving,app.stopped,run.finished,fleet.operated"; |
| 64 | 60 | /** How many of your apps the rail names before "All apps". */ |
| @@ -155,21 +151,6 @@ const appsRegion = (ctx: Ctx, user: User): Html => | ||
| 155 | 151 | ${yourApps(ctx, user)} |
| 156 | 152 | </div>`; |
| 157 | 153 | |
| 158 | const onYouRegion = ( | |
| 159 | ctx: Ctx, | |
| 160 | user: User, | |
| 161 | note?: string, | |
| 162 | section: Html = needsYouSection(ctx, user).body, | |
| 163 | ): Html => | |
| 164 | html`<div | |
| 165 | id="live-on-you" | |
| 166 | data-live="${ON_YOU_LIVE}" | |
| 167 | data-live-src="/live/on-you" | |
| 168 | > | |
| 169 | ${note === undefined ? null : html`<p class="small" role="status">${note}</p>`} | |
| 170 | ${section} | |
| 171 | </div>`; | |
| 172 | ||
| 173 | 154 | // GET /live/apps — your apps alone, for the region that shows them. |
| 174 | 155 | export function liveAppsFragment(ctx: Ctx): Response { |
| 175 | 156 | const user = ctx.auth.user; |
| @@ -177,21 +158,6 @@ export function liveAppsFragment(ctx: Ctx): Response { | ||
| 177 | 158 | return fragment(appsRegion(ctx, user), { request: ctx.request }); |
| 178 | 159 | } |
| 179 | 160 | |
| 180 | /** | |
| 181 | * What a bulk step on the On you list answers its own script with: the | |
| 182 | * region as it is now and the top bar's Asks link with its new count. | |
| 183 | */ | |
| 184 | export function onYouAnswer(ctx: Ctx, user: User, note?: string): Response { | |
| 185 | return fragment(html`<div>${onYouRegion(ctx, user, note)}</div>`); | |
| 186 | } | |
| 187 | ||
| 188 | // GET /live/on-you — what is on the viewer, alone. | |
| 189 | export function liveOnYouFragment(ctx: Ctx): Response { | |
| 190 | const user = ctx.auth.user; | |
| 191 | if (!user) return fragment(html``, { status: 404 }); | |
| 192 | return fragment(onYouRegion(ctx, user), { request: ctx.request }); | |
| 193 | } | |
| 194 | ||
| 195 | 161 | /** |
| 196 | 162 | * Home, signed in, is the feed (#599), for every viewer whatever the mode |
| 197 | 163 | * (#625): like opening X — the composer on top, then one timeline of posts |
| @@ -205,9 +171,7 @@ export function liveOnYouFragment(ctx: Ctx): Response { | ||
| 205 | 171 | export async function studioHome( |
| 206 | 172 | ctx: Ctx, |
| 207 | 173 | user: User, |
| 208 | top?: AsksTop, | |
| 209 | 174 | ): Promise<Response> { |
| 210 | const needsYou = needsYouSection(ctx, user, top); | |
| 211 | 175 | const { repos: appRepos } = writableAppsOf(ctx, user); |
| 212 | 176 | // A spawned forge says where it lives: the address its person shares. |
| 213 | 177 | const spawned = await spawnedOrg(ctx.app); |
| @@ -256,7 +220,7 @@ export async function studioHome( | ||
| 256 | 220 | ${homeTabs("feed")} |
| 257 | 221 | <div class="dash"> |
| 258 | 222 | <div class="dash-main stack"> |
| 259 | ${onYouRegion(ctx, user, undefined, needsYou.body)} ${composer(ctx, user)} | |
| 223 | ${composer(ctx, user)} | |
| 260 | 224 | <div class="bar feed-head"> |
| 261 | 225 | <span class="spacer"></span> |
| 262 | 226 | <a class="small muted" href="/asked">What you asked for</a> |
| @@ -281,7 +245,7 @@ export async function studioHome( | ||
| 281 | 245 | ctx, |
| 282 | 246 | title: "Home", |
| 283 | 247 | body, |
| 284 | scriptJs: `${liveClientJs}\n${liveRegionsJs}\n${feedJs}\n${needsYou.scriptJs}${ask ? `\n${passkeyJs}` : ""}`, | |
| 248 | scriptJs: `${liveClientJs}\n${liveRegionsJs}\n${feedJs}${ask ? `\n${passkeyJs}` : ""}`, | |
| 285 | 249 | }); |
| 286 | 250 | } |
| 287 | 251 |
test/asks-bulk.test.ts +1 −1
| @@ -76,7 +76,7 @@ describe("acting on many asks at once", () => { | ||
| 76 | 76 | }); |
| 77 | 77 | const location = res.headers.get("location"); |
| 78 | 78 | if (res.status === 303 && location !== null) { |
| 79 | expect(location).toStartWith("/?op="); | |
| 79 | expect(location).toStartWith("/asks?op="); | |
| 80 | 80 | const next = await fetch(`${servers.url}${location}`, { headers, redirect: "manual" }); |
| 81 | 81 | expect(next.status).toBe(200); |
| 82 | 82 | return (await next.text()).replace(/\s+/g, " "); |
test/asks-expiry.test.ts +7 −7
| @@ -126,7 +126,7 @@ describe("asks that expire, hold and collapse", () => { | ||
| 126 | 126 | pears = await botPull("pears", [{ path: "PEARS.md", content: "pears\n" }]); |
| 127 | 127 | green(apples); |
| 128 | 128 | green(pears); |
| 129 | const page = await get("/"); | |
| 129 | const page = await get("/asks"); | |
| 130 | 130 | expect(sentence(page)).toBe("1 thing needs you"); |
| 131 | 131 | expect(headerCount(page)).toBe(1); |
| 132 | 132 | expect(page).toContain("2 green changes wait for your look"); |
| @@ -152,7 +152,7 @@ describe("asks that expire, hold and collapse", () => { | ||
| 152 | 152 | // card at all, so there is nothing to mute. |
| 153 | 153 | const fragment = await get("/live/feed"); |
| 154 | 154 | expect(fragment).not.toContain('data-kind="ask"'); |
| 155 | const home = await get("/"); | |
| 155 | const home = await get("/asks"); | |
| 156 | 156 | expect(home).toContain('<section id="needs-you"'); |
| 157 | 157 | const at = home.indexOf('<section id="needs-you"'); |
| 158 | 158 | expect(home.slice(at, home.indexOf("</section>", at))).not.toContain( |
| @@ -169,7 +169,7 @@ describe("asks that expire, hold and collapse", () => { | ||
| 169 | 169 | repoId: repo.id, |
| 170 | 170 | actorId: null, |
| 171 | 171 | }); |
| 172 | let page = await get("/"); | |
| 172 | let page = await get("/asks"); | |
| 173 | 173 | expect(sentence(page)).toBe("All fine"); |
| 174 | 174 | expect(headerCount(page)).toBe(0); |
| 175 | 175 | expect(askLinesFor(app.db, aliceUser)).toHaveLength(0); |
| @@ -179,7 +179,7 @@ describe("asks that expire, hold and collapse", () => { | ||
| 179 | 179 | // A new check on one of them: that one asks again, on its own. |
| 180 | 180 | await tick(); |
| 181 | 181 | green(apples); |
| 182 | page = await get("/"); | |
| 182 | page = await get("/asks"); | |
| 183 | 183 | expect(sentence(page)).toBe("1 thing needs you"); |
| 184 | 184 | const pinned = page.slice( |
| 185 | 185 | page.indexOf('<section id="needs-you"'), |
| @@ -203,7 +203,7 @@ describe("asks that expire, hold and collapse", () => { | ||
| 203 | 203 | repoId: repo.id, |
| 204 | 204 | actorId: null, |
| 205 | 205 | }); |
| 206 | expect(sentence(await get("/"))).toBe("All fine"); | |
| 206 | expect(sentence(await get("/asks"))).toBe("All fine"); | |
| 207 | 207 | // The merge box is the change's Files step (#628). |
| 208 | 208 | const change = await get( |
| 209 | 209 | `/${repo.ownerName}/${repo.name}/pulls/${apples.number}/files`, |
| @@ -231,7 +231,7 @@ describe("asks that expire, hold and collapse", () => { | ||
| 231 | 231 | }); |
| 232 | 232 | await sweepStaleAsks(app); |
| 233 | 233 | expect(askLinesFor(app.db, aliceUser)).toHaveLength(0); |
| 234 | expect(sentence(await get("/"))).toBe("All fine"); | |
| 234 | expect(sentence(await get("/asks"))).toBe("All fine"); | |
| 235 | 235 | // The feed and the MCP's asks carry no green line for it either. |
| 236 | 236 | expect( |
| 237 | 237 | readFeed(app.db, aliceUser, { limit: 50 }).items.some( |
| @@ -241,7 +241,7 @@ describe("asks that expire, hold and collapse", () => { | ||
| 241 | 241 | expect(JSON.stringify(asksAnswer({ app, auth: { user: aliceUser } } as never, aliceUser))).not.toContain("is green"); |
| 242 | 242 | // Assigned to alice, the home's one list says it conflicts, never ready. |
| 243 | 243 | setAssignee(app.db, plums.id, aliceUser.id); |
| 244 | const home = await get("/"); | |
| 244 | const home = await get("/asks"); | |
| 245 | 245 | expect(home).toContain("conflicts with main"); |
| 246 | 246 | expect(askLinesFor(app.db, aliceUser).map((l) => l.waitingFor.word)).toEqual(["conflicts with main"]); |
| 247 | 247 | // Its own page still says why it cannot ship. |
test/asks-mute.test.ts +1 −1
| @@ -60,7 +60,7 @@ describe("muting a repository's asks", () => { | ||
| 60 | 60 | return ((await res.json()) as { rows: unknown[] }).rows; |
| 61 | 61 | }; |
| 62 | 62 | const home = async () => |
| 63 | await fetch(`${servers.url}/`, { headers: headers(cookie) }).then((r) => r.text()); | |
| 63 | await fetch(`${servers.url}/asks`, { headers: headers(cookie) }).then((r) => r.text()); | |
| 64 | 64 | |
| 65 | 65 | const signIn = async (username: string) => { |
| 66 | 66 | const res = await fetch(`${servers.url}/signin`, { |
test/asks-rank.test.ts +10 −4
| @@ -204,7 +204,7 @@ describe("asks that earn their place", () => { | ||
| 204 | 204 | expect(row.words).toEqual(ASK_WORDS.look); |
| 205 | 205 | expect(row.words.options.length).toBeGreaterThan(0); |
| 206 | 206 | } |
| 207 | const asks = await page("/"); | |
| 207 | const asks = await page("/asks"); | |
| 208 | 208 | expect(asks).toContain("If nobody acts, it waits; nothing ships."); |
| 209 | 209 | expect(asks).toContain("<b>security</b>"); |
| 210 | 210 | // The long sentence the card used to repeat is gone. |
| @@ -236,7 +236,13 @@ describe("asks that earn their place", () => { | ||
| 236 | 236 | for (const name of ["r4", "r5", "r6"]) |
| 237 | 237 | await greenPull(name, `Work in ${name}`); |
| 238 | 238 | // What needs you is pinned on the home (#634): count its own cards. |
| 239 | const home = await page("/"); | |
| 239 | const home = await page("/asks"); | |
| 240 | // ...and the owner's home carries none of the six, nor a count of them. | |
| 241 | const door = await page("/"); | |
| 242 | expect(home).toContain("6 things need you"); | |
| 243 | for (const gone of ['id="needs-you"', 'id="live-on-you"', 'id="asks-sentence"', 'id="ask-', "things need you", "6 things"]) | |
| 244 | expect(door).not.toContain(gone); | |
| 245 | expect(door).toMatch(/<a class="btn hide-sm"[^>]*href="\/asks">Asks<\/a/); | |
| 240 | 246 | const asks = home.slice(home.indexOf('<section id="needs-you"')); |
| 241 | 247 | const cards = (s: string) => (s.match(/class="card[" ]/g) ?? []).length; |
| 242 | 248 | // Two before the phone's "more", three more inside it before the wide |
| @@ -340,7 +346,7 @@ describe("asks that earn their place", () => { | ||
| 340 | 346 | expect((await mcpAsks()).measure.raised).toBe(6); |
| 341 | 347 | }); |
| 342 | 348 | test("a phone's ask is a full-width row: kind and repo on one line, the decider apart, the rest behind More", async () => { |
| 343 | const home = await page("/"); | |
| 349 | const home = await page("/asks"); | |
| 344 | 350 | const asks = home.slice(home.indexOf('<section id="needs-you"')); |
| 345 | 351 | expect(asks).toContain("ask-card"); |
| 346 | 352 | expect(asks).toContain('<b class="ask-kind">'); |
| @@ -357,7 +363,7 @@ describe("asks that earn their place", () => { | ||
| 357 | 363 | // The security pull went red above; a new green one joins it in a row of two. |
| 358 | 364 | check(security, "ok"); |
| 359 | 365 | await greenPull("security", "Another change here"); |
| 360 | const asks = await page("/"); | |
| 366 | const asks = await page("/asks"); | |
| 361 | 367 | expect(asks).toContain("2 green changes wait for your look"); |
| 362 | 368 | expect(asks).toContain("<b>security</b>: \u201cWiden the board id\u201d"); |
| 363 | 369 | // On a phone the row is its head line, its two asks one tap away; a |
test/asks-waiting-for.test.ts +1 −1
| @@ -150,7 +150,7 @@ describe("the word on a row", () => { | ||
| 150 | 150 | expect(text).toContain("ready to land"); |
| 151 | 151 | expect(text).toContain("waitingFor"); |
| 152 | 152 | |
| 153 | const page = await (await fetch(`${servers.url}/`, { headers: { cookie } })).text(); | |
| 153 | const page = await (await fetch(`${servers.url}/asks`, { headers: { cookie } })).text(); | |
| 154 | 154 | expect(page).toContain('data-waiting="ready to land"'); |
| 155 | 155 | expect(page).toContain('<span class="sr-only">waiting for </span>ready to land'); |
| 156 | 156 | expect(page).toContain("ready to land · on you"); |
test/asks.test.ts +15 −15
| @@ -104,16 +104,16 @@ describe("the asks page", () => { | ||
| 104 | 104 | }); |
| 105 | 105 | |
| 106 | 106 | test("when nothing asks, it says All fine, and so does the header", async () => { |
| 107 | const page = await get(alice, "/"); | |
| 107 | const page = await get(alice, "/asks"); | |
| 108 | 108 | expect(sentence(page)).toBe("All fine"); |
| 109 | 109 | expect(headerCount(page)).toBe(0); |
| 110 | expect(await get(alice, "/")).not.toContain('<section id="needs-you"'); | |
| 110 | expect(await get(alice, "/asks")).not.toContain('<section id="needs-you"'); | |
| 111 | 111 | }); |
| 112 | 112 | |
| 113 | test("/asks lands on the home's pinned needs-you, and a signed-out reader there gets the door, no asks", async () => { | |
| 113 | test("/asks is the page of asks; a signed-out reader is sent to sign in, and the door shows no asks", async () => { | |
| 114 | 114 | const response = await fetch(`${servers.url}/asks`, { redirect: "manual" }); |
| 115 | 115 | expect(response.status).toBe(303); |
| 116 | expect(response.headers.get("location")).toBe("/#needs-you"); | |
| 116 | expect(response.headers.get("location")).toBe("/signin?next=%2Fasks"); | |
| 117 | 117 | const door = await (await fetch(`${servers.url}/`)).text(); |
| 118 | 118 | expect(door).not.toContain('id="needs-you"'); |
| 119 | 119 | expect(door).not.toContain('id="asks-sentence"'); |
| @@ -146,7 +146,7 @@ describe("the asks page", () => { | ||
| 146 | 146 | claimRun(app.db, run.id); |
| 147 | 147 | finishRun(app.db, run.id, { state: "failed", summary: "red" }); |
| 148 | 148 | // Failed but the crew is still trying: that is working, not an ask. |
| 149 | expect(sentence(await get(alice, "/"))).toBe("All fine"); | |
| 149 | expect(sentence(await get(alice, "/asks"))).toBe("All fine"); | |
| 150 | 150 | recordDecision(app.db, { |
| 151 | 151 | kind: "retry", |
| 152 | 152 | repoId: repo.id, |
| @@ -157,16 +157,16 @@ describe("the asks page", () => { | ||
| 157 | 157 | by: "rule", |
| 158 | 158 | ms: 1, |
| 159 | 159 | }); |
| 160 | const page = await get(alice, "/"); | |
| 160 | const page = await get(alice, "/asks"); | |
| 161 | 161 | expect(sentence(page)).toBe("1 thing needs you"); |
| 162 | 162 | expect(page).toContain("Bot did a thing"); |
| 163 | 163 | expect(headerCount(page)).toBe(1); |
| 164 | 164 | // The home counts it in the header's Asks link; the dev dashboard's |
| 165 | 165 | // own "needs you" line went with the dashboard (#625). |
| 166 | const home = await get(alice, "/"); | |
| 166 | const home = await get(alice, "/asks"); | |
| 167 | 167 | expect(headerCount(home)).toBe(1); |
| 168 | 168 | // Bob can read the public repository but cannot write it: not his ask. |
| 169 | expect(sentence(await get(bob, "/"))).toBe("All fine"); | |
| 169 | expect(sentence(await get(bob, "/asks"))).toBe("All fine"); | |
| 170 | 170 | }); |
| 171 | 171 | |
| 172 | 172 | test("a forge health problem is a card for an admin and for no one else", async () => { |
| @@ -174,11 +174,11 @@ describe("the asks page", () => { | ||
| 174 | 174 | app.db |
| 175 | 175 | .query("UPDATE run SET created_at = ?1 WHERE state = 'queued'") |
| 176 | 176 | .run(new Date(Date.now() - 3 * 3_600_000).toISOString()); |
| 177 | const admin = await get(alice, "/"); | |
| 177 | const admin = await get(alice, "/asks"); | |
| 178 | 178 | expect(admin).toContain("behind one lane"); |
| 179 | 179 | expect(sentence(admin)).toBe("2 things need you"); |
| 180 | 180 | expect(headerCount(admin)).toBe(2); |
| 181 | const other = await get(bob, "/"); | |
| 181 | const other = await get(bob, "/asks"); | |
| 182 | 182 | expect(other).not.toContain("behind one lane"); |
| 183 | 183 | expect(sentence(other)).toBe("All fine"); |
| 184 | 184 | }); |
| @@ -224,17 +224,17 @@ describe("the asks page", () => { | ||
| 224 | 224 | ms: 1, |
| 225 | 225 | }); |
| 226 | 226 | const card = `id="ask-stopped:${pull.id}"`; |
| 227 | expect(await get(alice, "/")).toContain(card); | |
| 227 | expect(await get(alice, "/asks")).toContain(card); | |
| 228 | 228 | // The re-run passes: the stop is answered, and the pull is green. |
| 229 | 229 | check("ok"); |
| 230 | 230 | resolveOpen(app.db, pull.id, "retry", "green"); |
| 231 | const green = await get(alice, "/"); | |
| 231 | const green = await get(alice, "/asks"); | |
| 232 | 232 | expect(green).not.toContain(card); |
| 233 | 233 | expect(green).toContain(`id="ask-look:${pull.id}"`); |
| 234 | 234 | // Red again, before anything new is decided: the old stop is spent, and |
| 235 | 235 | // the crew's tries are what the card is counted from. |
| 236 | 236 | check("failed"); |
| 237 | expect(await get(alice, "/")).not.toContain(card); | |
| 237 | expect(await get(alice, "/asks")).not.toContain(card); | |
| 238 | 238 | }); |
| 239 | 239 | |
| 240 | 240 | test("a green change's card says what its tests did", async () => { |
| @@ -309,11 +309,11 @@ describe("the asks page", () => { | ||
| 309 | 309 | expect(card.says).toContain("alice"); |
| 310 | 310 | expect(card.says).toContain("checks.concurrency"); |
| 311 | 311 | expect(ASK_WORDS.setting.options).toEqual(["Keep", "Put back"]); |
| 312 | const page = await get(alice, "/"); | |
| 312 | const page = await get(alice, "/asks"); | |
| 313 | 313 | expect(page).toContain("Keep"); |
| 314 | 314 | expect(page).toContain("Put back"); |
| 315 | 315 | // not for a person who cannot put it back |
| 316 | expect(await get(bob, "/")).not.toContain("Put back"); | |
| 316 | expect(await get(bob, "/asks")).not.toContain("Put back"); | |
| 317 | 317 | expect(listEvents(app.db, { kind: "issue.assigned" }).length).toBe(0); |
| 318 | 318 | }); |
| 319 | 319 |
test/hand-decider.test.ts +1 −1
| @@ -81,7 +81,7 @@ describe("let the decider answer a hand-over", () => { | ||
| 81 | 81 | redirect: "manual", |
| 82 | 82 | }); |
| 83 | 83 | |
| 84 | const home = async (path = "/"): Promise<string> => | |
| 84 | const home = async (path = "/asks"): Promise<string> => | |
| 85 | 85 | (await (await fetch(`${servers.url}${path}`, { headers: { cookie } })).text()).replace(/\s+/g, " "); |
| 86 | 86 | |
| 87 | 87 | beforeAll(async () => { |
test/home-feed.test.ts +2 −2
| @@ -371,7 +371,7 @@ describe("home is the feed", () => { | ||
| 371 | 371 | if (!one.ok || !two.ok) throw new Error("issues"); |
| 372 | 372 | for (const [repo, issue] of [[garden, one.value], [vault, two.value]] as const) |
| 373 | 373 | expect(assignIssue(app, alice, repo, issue, alice).ok).toBe(true); |
| 374 | const text = await (await get("/", aliceCookie)).text(); | |
| 374 | const text = await (await get("/asks", aliceCookie)).text(); | |
| 375 | 375 | const card = text.slice(text.indexOf('id="live-on-you"')).replace(/\s+/g, " "); |
| 376 | 376 | expect(card).toContain("things need you"); |
| 377 | 377 | expect(card).toContain("assigned to you"); |
| @@ -389,7 +389,7 @@ describe("home is the feed", () => { | ||
| 389 | 389 | expect(text).toContain("fleet.operated"); |
| 390 | 390 | expect(text).toContain("data-pick"); |
| 391 | 391 | // Alone, a single row stays a plain link. |
| 392 | const bobCard = await (await get("/", bobCookie)).text(); | |
| 392 | const bobCard = await (await get("/asks", bobCookie)).text(); | |
| 393 | 393 | expect(bobCard).not.toContain('id="asks-bulk"'); |
| 394 | 394 | }); |
| 395 | 395 | }); |
test/live-pages.test.ts +5 −1
| @@ -161,8 +161,12 @@ describe("live browsing pages", () => { | ||
| 161 | 161 | }) |
| 162 | 162 | ).text(); |
| 163 | 163 | expect(html).toContain('id="live-apps"'); |
| 164 | expect(html).toContain('id="live-on-you"'); | |
| 164 | expect(html).not.toContain('id="live-on-you"'); | |
| 165 | 165 | expect(html).toContain("new EventSource('/events')"); |
| 166 | const asks = await ( | |
| 167 | await fetch(`${base}/asks`, { headers: { cookie: `${cookie}; forge_mode=studio` } }) | |
| 168 | ).text(); | |
| 169 | expect(asks).toContain('id="live-on-you"'); | |
| 166 | 170 | }); |
| 167 | 171 | |
| 168 | 172 | test("a live region never swaps out from under a card that is mid-decision", async () => { |
test/planner-declined.test.ts +3 −1
| @@ -183,7 +183,9 @@ describe("the planner declined, waiting for a person", () => { | ||
| 183 | 183 | expect(board).toContain( |
| 184 | 184 | `action="/alice/garden/issues/${direction.number}/comments"`, |
| 185 | 185 | ); |
| 186 | const asks = await page(aliceCookie, "/"); | |
| 186 | // The owner's home shows no asks (#2764): the decline is on the asks page. | |
| 187 | expect(await page(aliceCookie, "/")).not.toContain("The planner declined the direction"); | |
| 188 | const asks = await page(aliceCookie, "/asks"); | |
| 187 | 189 | expect(asks).toContain("The planner declined the direction"); |
| 188 | 190 | expect(asks).toContain( |
| 189 | 191 | `/alice/garden/issues/${direction.number}#comment-body`, |
test/proposal-card.test.ts +1 −1
| @@ -156,7 +156,7 @@ describe("a wave proposal is one inbox card", () => { | ||
| 156 | 156 | test("home shows the Redirect box on the card, and Later's way back", async () => { |
| 157 | 157 | const id = propose("Home wave"); |
| 158 | 158 | const get = async () => |
| 159 | (await (await fetch(`${servers.url}/`, { headers: { cookie: `${aliceCookie}; forge_mode=studio` } })).text()); | |
| 159 | (await (await fetch(`${servers.url}/asks`, { headers: { cookie: `${aliceCookie}; forge_mode=studio` } })).text()); | |
| 160 | 160 | expect(await get()).toContain(`/asks/proposal/${id}/redirect`); |
| 161 | 161 | await post(aliceCookie, `/asks/proposal/${id}/later`, [["back", "/"]]); |
| 162 | 162 | const page = await get(); |
test/review-wait.test.ts +1 −1
| @@ -34,7 +34,7 @@ describe("a green agent pull and its reviewer", () => { | ||
| 34 | 34 | |
| 35 | 35 | const home = async (): Promise<string> => |
| 36 | 36 | ( |
| 37 | await (await fetch(`${servers.url}/`, { headers: { cookie } })).text() | |
| 37 | await (await fetch(`${servers.url}/asks`, { headers: { cookie } })).text() | |
| 38 | 38 | ).replace(/\s+/g, " "); |
| 39 | 39 | const wordCtx = (): WordCtx => ({ db: app.db }) as unknown as WordCtx; |
| 40 | 40 |
test/web.test.ts +3
| @@ -1,4 +1,5 @@ | ||
| 1 | 1 | import { afterAll, beforeAll, describe, expect, test } from "bun:test"; |
| 2 | import { quietLogs } from "./helpers/globals.ts"; | |
| 2 | 3 | import { mkdtemp, rm } from "node:fs/promises"; |
| 3 | 4 | import { tmpdir } from "node:os"; |
| 4 | 5 | import { join } from "node:path"; |
| @@ -900,6 +901,8 @@ describe("the security floor is on every response", () => { | ||
| 900 | 901 | }); |
| 901 | 902 | |
| 902 | 903 | describe("a refused cross-origin mutation says why in the log", () => { |
| 904 | // The refusal is a warning: hold the floor there, whatever an earlier file left. | |
| 905 | quietLogs("warn"); | |
| 903 | 906 | let dataDir: string; |
| 904 | 907 | let app: App; |
| 905 | 908 | let servers: Servers; |
new above
offline