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

"Report a problem (no account needed)" lives in one place, read by the app proxy, the API and the standards pages #5643

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

mason/forge:mason/5624-report-a-problem-no-account-needed-lives → main 4 commits fork 1 thread · 1 unresolved

  • Merged. mason/5624-report-a-problem-no-account-needed-lives was merged into main as d9b495f.

Review

Sign in to review this change.
5 files changed +40 −6
src/actions/report_words.ts +8 −3
@@ -1,9 +1,14 @@
11 /**
2 * The words an outsider reads back after filing a report. Every door — the
3 * API's POST …/reports and the MCP `report` tool — answers from here, so
4 * the sentence reads the same wherever the report came in.
2 * The words a stranger is offered for reporting a problem and reads back
3 * after filing one, said once here. The app proxy's Link header, the API's
4 * refusal and POST …/reports, the MCP `report` tool and the standards pages'
5 * help link all read from here, so the words are the same wherever they
6 * appear.
57 */
68
9 /** The title of the link to report a problem without an account. */
10 export const REPORT_LINK_TITLE = "Report a problem (no account needed)";
11
712 /** The answer to a report that was filed and now waits for a person. */
813 export const REPORT_RECEIVED =
914 "Received. A person who maintains this repository will read it; nothing acts on it before they do.";
src/apps/proxy.ts +2 −1
@@ -20,6 +20,7 @@ import { getIssue, type Issue } from "../core/issues.ts";
2020 import { mayView } from "../core/sealed.ts";
2121 import { holdOpen } from "../http/caller.ts";
2222 import { appHostSuffix } from "./host.ts";
23 import { REPORT_LINK_TITLE } from "../actions/report_words.ts";
2324 import { createHmac, timingSafeEqual } from "node:crypto";
2425 import type { App } from "../app.ts";
2526 import { getAppById, getAppBySlug, type AppRecord } from "../core/apps.ts";
@@ -632,7 +633,7 @@ function reportUrl(runtime: AppsRuntime, target: AppTarget): URL | undefined {
632633
633634 /** The link relation a public app's pages carry to `/__forge/report`. */
634635 const REPORT_LINK =
635 '</__forge/report>; rel="help"; title="Report a problem (no account needed)"';
636 `</__forge/report>; rel="help"; title="${REPORT_LINK_TITLE}"`;
636637
637638 const isHtml = (headers: Headers): boolean =>
638639 (headers.get("content-type") ?? "").toLowerCase().startsWith("text/html");
src/http/api.ts +2 −1
@@ -81,6 +81,7 @@ import {
8181 import { resendVerification } from "../actions/verify.ts";
8282 import { PROVE_FIRST } from "../actions/verify_words.ts";
8383 import { CAPPED_WORDS } from "../actions/mail.ts";
84 import { REPORT_LINK_TITLE } from "../actions/report_words.ts";

Nit: api.ts already imports REPORT_RECEIVED from this module further down; one import of both names reads cleaner.

8485 import { VERIFY_WORDS } from "../actions/verify_words.ts";
8586 import { editMessage } from "../actions/edit_words.ts";
8687 import { emailVerified } from "../core/verify.ts";
@@ -516,7 +517,7 @@ function reportInstead(ctx: Ctx, repo: Repo): Response {
516517 report: { page, api, method: "POST", fields: ["title", "body", "page"] },
517518 },
518519 401,
519 { link: `<${page}>; rel="help"; title="Report a problem (no account needed)"` },
520 { link: `<${page}>; rel="help"; title="${REPORT_LINK_TITLE}"` },
520521 );
521522 }
522523
src/web/standards.ts +2 −1
@@ -27,6 +27,7 @@ import releases from "../core/releases.json" with { type: "json" };
2727 import { markPng, type MarkShape } from "../design/mark.ts";
2828 import { metaThemeColor } from "../design/themes.ts";
2929 import { BODY_MAX, TITLE_MAX } from "../core/reports.ts";
30 import { REPORT_LINK_TITLE } from "../actions/report_words.ts";
3031 import { sshTellCommand } from "../ssh/command.ts";
3132 import { llmsRepos, sitemapRepos } from "../core/listings.ts";
3233 import { canRead, getRepo } from "../core/repos.ts";
@@ -404,7 +405,7 @@ export function pageLinks(ctx: Ctx): PageLink[] {
404405 links.push({
405406 rel: "help",
406407 href: `/${repo.ownerName}/${repo.name}/report`,
407 title: "Report a problem (no account needed)",
408 title: REPORT_LINK_TITLE,
408409 });
409410 }
410411 return links;

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs