diff --git a/src/lib/i18n/en.ts b/src/lib/i18n/en.ts index 8a8970f..b7550ba 100644 --- a/src/lib/i18n/en.ts +++ b/src/lib/i18n/en.ts @@ -172,6 +172,8 @@ export const en: Messages = { openContribution: { contribute: "Open Contribution", contributeNote: "Contribute to this note", + suggestEdit: "Suggest Edit", + suggestNote: "Suggest Note", queueHeading: "Submitted open contributions", queueEmpty: "No pending open contributions.", by: "Submitted by", diff --git a/src/lib/i18n/fr.ts b/src/lib/i18n/fr.ts index 538ce64..65152ce 100644 --- a/src/lib/i18n/fr.ts +++ b/src/lib/i18n/fr.ts @@ -176,6 +176,8 @@ export const fr: PartialMessages = { openContribution: { contribute: "Contribuer ouvertement", contributeNote: "Contribuer à cette note", + suggestEdit: "Suggérer une modification", + suggestNote: "Suggérer une note", queueHeading: "Contributions ouvertes soumises", queueEmpty: "Aucune contribution en attente.", by: "Soumise par", diff --git a/src/lib/i18n/index.ts b/src/lib/i18n/index.ts index 3b7679b..2441129 100644 --- a/src/lib/i18n/index.ts +++ b/src/lib/i18n/index.ts @@ -169,6 +169,8 @@ export interface Messages { openContribution: { contribute: string; contributeNote: string; + suggestEdit: string; + suggestNote: string; queueHeading: string; queueEmpty: string; by: string; diff --git a/src/lib/i18n/ja.ts b/src/lib/i18n/ja.ts index d9e512e..32cf860 100644 --- a/src/lib/i18n/ja.ts +++ b/src/lib/i18n/ja.ts @@ -178,6 +178,8 @@ export const ja: PartialMessages = { openContribution: { contribute: "オープン投稿", contributeNote: "このノートに投稿する", + suggestEdit: "編集を提案", + suggestNote: "ノートを提案", queueHeading: "投稿されたオープン投稿", queueEmpty: "保留中の投稿はありません。", by: "投稿者", diff --git a/src/views/layout.ts b/src/views/layout.ts index 0d42cfa..0f537f0 100644 --- a/src/views/layout.ts +++ b/src/views/layout.ts @@ -18,6 +18,7 @@ import { } from "../lib/urls.ts"; import { ICONS } from "./icons.ts"; import { + contributionSmallButtonClass, dangerSmallButtonClass, fieldFocusClass, kbdClass, @@ -166,11 +167,27 @@ function renderWithSidebar(body: string, options: LayoutOptions): string { ? `${msg.wiki.newNote}` : ""; + // Open contributions: a non-contributor on an open wiki suggests changes rather + // than editing directly. "Suggest Edit" replaces the edit action on a note; + // "Suggest Note" offers a new note. Both route through the submission queue. + const suggestEditLink = + options?.canSubmitContribution && options.currentNoteSlug + ? `${msg.openContribution.suggestEdit}` + : ""; + const suggestNoteLink = options?.canSubmitContribution + ? `${msg.openContribution.suggestNote}` + : ""; + // The button tokens are inline-flex, and Tailwind emits .inline-flex after // .block, so a `block` on the anchor loses regardless of attribute order and // the buttons sit side by side. Flex children are blockified, which stacks // them full-width without fighting the token's display. - const noteActions = [editLink, newNoteLink].filter(Boolean); + const noteActions = [ + editLink, + newNoteLink, + suggestEditLink, + suggestNoteLink, + ].filter(Boolean); const noteActionsBlock = noteActions.length ? `