Skip to content

Commit bb27ebd

Browse files
committed
feat: add configurable page actions and demo palette switch
1 parent 53aa9a4 commit bb27ebd

37 files changed

Lines changed: 1598 additions & 124 deletions

‎AGENTS.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ Quiet is a reusable, MIT-licensed Docusaurus theme layered over theme-classic.
3838
- API operations use the full available main column for reference and explorer panels. Guide prose retains its reading width. The website is hosted at quiet.techdocs.studio, with Netlify serving the root path.
3939

4040
- Use Classic DocCardList for navigation cards rather than handwritten card HTML. Keep cards separated and free of link underlines. Preserve logo aspect ratios. Use Steps for detailed procedures and retain existing Markdown heading IDs. Filled widget actions keep the primary brand color and a contrasting foreground in both modes; dark link accents are separate.
41+
42+
- Page actions preserve the insertion order of the owner's dictionary, including custom link/copy actions. Missing MCP configuration creates no MCP entries. Never execute copied commands. Reuse the host's assistant and feedback SDKs. Disabled page actions restore Classic's edit link. Feedback defaults to the right rail, with a document-footer fallback on mobile or pages without a rail.

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## 0.1.0 — unreleased
44

5+
- Add ordered, extensible page actions. Copy page copies Markdown, with optional Ask AI, source links, editing and MCP commands.
6+
- Add a demo-only navbar button that cycles through persistent brand palettes.
7+
- Move optional page feedback into the desktop right rail, with a mobile fallback.
8+
59
- Space navigation cards consistently, preserve logo proportions and support Markdown headings inside steps.
610
- Keep filled widget controls legible in dark mode without changing the link palette.
711

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Use Docusaurus settings for your logo, navigation and content. Configure colors
2929
- Light and dark modes, readable typography and compact controls.
3030
- Guides, API references, code, callouts, tables and diagrams.
3131
- Optional search, Ask AI and page feedback. Your provider stays yours.
32+
- Configurable page actions, Markdown links and MCP setup commands.
3233

3334
Quiet keeps Classic's navigation, routing, keyboard controls and metadata.
3435

‎VALIDATION.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,11 @@ The Biel migration uses Classic DocCardList for 73 navigation cards. Their desti
6363
The PushFeedback navbar uses the current public website mark and an editable text wordmark. Its mark renders square at 30px on desktop and 24px on mobile. The theme preserves image aspect ratios rather than compressing full-image logos.
6464

6565
Dark-mode widget checks confirmed a white Biel search symbol on #191a18 and a white PushFeedback Send label on #2563eb. Filled actions keep the primary color while links can use a lighter dark-mode accent. Both consumer pages fit a 320px viewport; navigation cards become a single column. No AI question, rating or feedback submission was sent.
66+
67+
## Page action controls
68+
69+
The default menu reuses Biel's existing button without sending a question. Keyboard arrows navigate its items, Escape closes it and returns focus to the trigger. Copy actions report success; MCP command templates quote the server URL and name. A separate local build renders custom Copy link, Support and Copy body entries in exactly that dictionary order. A disabled-provider build with pageActions false has no controls or SDKs and restores the Classic footer edit link.
70+
71+
At 320px, the menu remains inside the viewport and one feedback control group is visible below the document. At desktop width, one group is in the right rail and the footer group is hidden. Missing MCP configuration produces no entries. The package still includes no service SDK or fixed project IDs.
72+
73+
Copy page is the default primary action and always produces Markdown. Conversion tests cover headings, nested lists, absolute links, GFM tables, fenced code and removal of document controls. The source action is conditional on a configured Markdown export. Browser checks confirm one visible copy/check icon per code control and temporary check marks on individual page/MCP copy actions. The demo palette control synchronizes the Branding inputs and configuration and survives reloads. It lives only in the website, outside the 45-file theme package.

‎package-lock.json‎

Lines changed: 145 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/theme/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ Search, AI assistance and feedback are optional integrations. The theme loads no
4242
The footer shows **Powered by Quiet** by default. Set `showCredit: false` to remove it.
4343

4444
MIT · By [TechDocs Studio](https://techdocs.studio).
45+
46+
[Page actions](https://quiet.techdocs.studio/components/page-actions) are an ordered, extensible dictionary. Add links or copy buttons, configure MCP commands, or disable the module. Optional PushFeedback thumbs sit beside the document on desktop.

‎packages/theme/index.cjs‎

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
const path = require("node:path");
2+
const {
3+
normalizeActions,
4+
resolveActions,
5+
resolveFeedback,
6+
} = require("./src/page-actions.cjs");
27

38
const defaults = {
49
accentColor: "#191a18",
510
accentColorDark: "#e9ecef",
611
showCredit: true,
12+
pageActions: {},
13+
feedback: {},
714
};
815

916
function normalizeOptions({ id = "default", ...options } = {}) {
@@ -24,15 +31,30 @@ function normalizeOptions({ id = "default", ...options } = {}) {
2431
if (typeof result.showCredit !== "boolean") {
2532
throw new Error("Quiet: showCredit must be a boolean.");
2633
}
34+
result.pageActions = normalizeActions(result.pageActions);
35+
if (
36+
result.feedback !== false &&
37+
(!result.feedback ||
38+
typeof result.feedback !== "object" ||
39+
Array.isArray(result.feedback))
40+
)
41+
throw new Error("Quiet: feedback must be an object or false.");
2742
return { ...result, id };
2843
}
2944

30-
function quietTheme(_context, options) {
45+
function quietTheme(context, options) {
3146
const config = normalizeOptions(options);
47+
const site = context.siteConfig || {};
48+
const pageActions = resolveActions(site, config);
49+
const feedback = resolveFeedback(site, config.feedback);
3250
return {
3351
name: "docusaurus-theme-quiet",
3452
contentLoaded: ({ actions }) =>
35-
actions.setGlobalData({ showCredit: config.showCredit }),
53+
actions.setGlobalData({
54+
showCredit: config.showCredit,
55+
pageActions,
56+
feedback,
57+
}),
3658
getThemePath: () => path.join(__dirname, "src/theme"),
3759
getClientModules: () => [
3860
path.join(__dirname, "src/styles.css"),

‎packages/theme/index.d.ts‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,57 @@
11
import type { LoadContext, Plugin } from "@docusaurus/types";
22

3+
export type ActionIcon =
4+
| false
5+
| "biel"
6+
| "sparkles"
7+
| "bot"
8+
| "search"
9+
| "message-circle"
10+
| "copy"
11+
| "link"
12+
| "external-link"
13+
| "file"
14+
| "terminal"
15+
| { src: string };
16+
export interface Action {
17+
label?: string;
18+
url?: string;
19+
copy?: string;
20+
selector?: string;
21+
icon?: ActionIcon;
22+
}
23+
export interface McpAction {
24+
url: string;
25+
name?: string;
26+
clients?: Record<string, false | { label?: string; command?: string }>;
27+
}
28+
export interface PageActions {
29+
[name: string]: false | Action | McpAction | undefined;
30+
copyPage?: false | (Action & { exclude?: string[] });
31+
askAi?: false | Action;
32+
viewSource?: false | (Action & { exclude?: string[] });
33+
editPage?: false | Action;
34+
mcp?: false | McpAction;
35+
}
36+
337
export interface Options {
438
/** Light-mode accent. Six-digit hex color. Default: #191a18. */
539
accentColor?: string;
640
/** Dark-mode accent. Six-digit hex color. Default: #e9ecef. */
741
accentColorDark?: string;
842
/** Show the optional Powered by Quiet footer link. Default: true. */
943
showCredit?: boolean;
44+
/** Page action defaults merge with this dictionary. False disables the module. */
45+
pageActions?: false | PageActions;
46+
/** Optional PushFeedback controls. The host loads its widget SDK. */
47+
feedback?:
48+
| false
49+
| {
50+
project?: string;
51+
label?: string;
52+
position?: "sidebar" | "footer";
53+
successMessage?: string;
54+
};
1055
}
1156

1257
export default function quietTheme(

‎packages/theme/package.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
"access": "public"
4646
},
4747
"dependencies": {
48-
"lucide-react": "^0.468.0"
48+
"lucide-react": "^0.468.0",
49+
"turndown": "^7.2.5",
50+
"turndown-plugin-gfm": "^1.0.2"
4951
}
5052
}

0 commit comments

Comments
 (0)