Skip to content

Commit 504618e

Browse files
committed
fix: refine mobile navigation and widget presentation
1 parent fb0acb1 commit 504618e

5 files changed

Lines changed: 123 additions & 2 deletions

File tree

‎packages/theme/NOTICE‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
Quiet uses Lucide icons. The OpenAPI CSS glyphs are derived from Lucide.
22

3+
The mobile secondary menu adapts Docusaurus theme-classic.
4+
Copyright (c) Meta Platforms, Inc. and affiliates.
5+
Licensed under the MIT License:
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
24+
325
ISC License
426

527
Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.

‎packages/theme/src/styles.css‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@ h1 {
191191
.theme-doc-breadcrumbs .breadcrumbs__item:first-child .breadcrumbs__link {
192192
padding-inline-start: 0;
193193
}
194+
.theme-doc-breadcrumbs a.breadcrumbs__link:hover {
195+
background: transparent;
196+
color: var(--quiet-accent);
197+
text-decoration: underline;
198+
text-underline-offset: 3px;
199+
}
194200
.theme-doc-markdown {
195201
max-width: var(--quiet-content-width, 48rem);
196202
padding-block: 0.5rem 2rem;
@@ -575,6 +581,18 @@ biel-search-button:not(.hydrated) {
575581
padding-top: 1rem;
576582
}
577583
}
584+
.quiet-mobile-back {
585+
display: flex;
586+
align-items: center;
587+
gap: 0.5rem;
588+
text-align: start;
589+
}
590+
.quiet-mobile-back svg {
591+
flex: none;
592+
}
593+
html[dir="rtl"] .quiet-mobile-back svg {
594+
transform: rotate(180deg);
595+
}
578596
@media (max-width: 560px) {
579597
.quiet-card-grid {
580598
grid-template-columns: 1fr;
@@ -719,6 +737,10 @@ html:root {
719737
box-shadow: none;
720738
}
721739
/* Optional integrations inherit tokens. No service is loaded by this stylesheet. */
740+
biel-bot,
741+
biel-search {
742+
font-size: 16px;
743+
}
722744
biel-search-button,
723745
biel-button,
724746
biel-bot {
@@ -757,6 +779,7 @@ biel-bot {
757779
height: var(--quiet-feedback-size);
758780
}
759781
.pushfeedback-thumbs-row .quiet-feedback-thumb::part(button) {
782+
z-index: 0;
760783
width: var(--quiet-feedback-size);
761784
height: var(--quiet-feedback-size);
762785
min-width: 0;
@@ -799,6 +822,14 @@ html:root {
799822
--biel-text-font-size: 16px;
800823
--biel-text-lg-font-size: 16px;
801824
--biel-text-xl-font-size: 18px;
825+
--biel-header-font-size: 18px;
826+
--biel-message-font-size: 16px;
827+
--biel-message-label-font-size: 14px;
828+
--biel-message-code-font-size: 14px;
829+
--biel-message-source-font-size: 14px;
830+
--biel-suggested-questions-font-size: 16px;
831+
--biel-suggested-questions-title-font-size: 14px;
832+
--biel-footer-font-size: 14px;
802833
--biel-primary-color: var(--quiet-accent);
803834
--biel-primary-light-color: var(--quiet-accent);
804835
--biel-primary-hover-color: var(--quiet-accent-hover);
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Adapted from Docusaurus theme-classic (Meta Platforms, Inc.; MIT license).
2+
import React from "react";
3+
import { translate } from "@docusaurus/Translate";
4+
import { useThemeConfig } from "@docusaurus/theme-common";
5+
import { useNavbarSecondaryMenu } from "@docusaurus/theme-common/internal";
6+
import { ChevronLeft } from "lucide-react";
7+
8+
export default function QuietMobileSecondaryMenu() {
9+
const { navbar } = useThemeConfig();
10+
const secondaryMenu = useNavbarSecondaryMenu();
11+
const label = translate({
12+
id: "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",
13+
message: "← Back to main menu",
14+
description: "Return to the main mobile navigation menu",
15+
}).replace(/^[←→]\s*/u, "");
16+
17+
return (
18+
<>
19+
{navbar.items.length > 0 && (
20+
<button
21+
type="button"
22+
className="clean-btn navbar-sidebar__back quiet-mobile-back"
23+
onClick={() => secondaryMenu.hide()}
24+
>
25+
<ChevronLeft size={16} strokeWidth={1.6} aria-hidden="true" />
26+
{label}
27+
</button>
28+
)}
29+
{secondaryMenu.content}
30+
</>
31+
);
32+
}

‎website/docs/components/page-actions.mdx‎

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ description: Copy pages as Markdown, open an assistant and configure document ac
55

66
**Copy page** copies the document as Markdown. The adjacent menu holds optional actions for your assistant, source file, editor and MCP server.
77

8+
## Where actions appear
9+
10+
The menu appears beside the breadcrumbs on documentation pages, including generated OpenAPI pages that use Docusaurus's document layout. On narrow screens it wraps below the breadcrumbs. Generated category indexes, blog posts and standalone pages do not show it.
11+
12+
Copy page works immediately, without Biel, an MCP server or a Markdown export plugin. Other actions appear when their requirements are configured. The same configuration applies across document versions, locales and docs plugin instances.
13+
814
## Configure the menu
915

1016
`pageActions` is an ordered dictionary. Your keys appear first, in the order written. Omitted defaults follow them. The first visible action becomes the main button. Set an entry to `false` to remove it.
@@ -27,10 +33,29 @@ themes: [
2733
| `copyPage` | Enabled by default; always copies Markdown |
2834
| `askAi` | Biel has a project, or you configure an assistant selector |
2935
| `viewSource` | You provide a Markdown export URL |
30-
| `editPage` | Docusaurus provides an `editUrl` |
36+
| `editPage` | The document has an edit URL from Docusaurus `editUrl` |
3137
| `mcp` | You provide a server URL |
3238

33-
Disabling `editPage` restores Classic's footer edit link. Disable the whole module with `pageActions: false`.
39+
The example above keeps Copy page as the main button, then orders Ask AI, Contact support and Suggest a change in the menu. Any remaining defaults follow those entries when available.
40+
41+
Disabling `editPage` restores Classic's footer edit link. Disable the whole module with `pageActions: false`:
42+
43+
```js title="docusaurus.config.js"
44+
themes: [["docusaurus-theme-quiet", {pageActions: false}]],
45+
```
46+
47+
To replace the menu with only your own actions, disable the defaults explicitly:
48+
49+
```js
50+
pageActions: {
51+
support: {label: "Contact support", url: "https://example.com/support"},
52+
copyPage: false,
53+
askAi: false,
54+
viewSource: false,
55+
editPage: false,
56+
mcp: false,
57+
},
58+
```
3459

3560
## Markdown
3661

‎website/docs/integrations/ask-ai.mdx‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,17 @@ When Biel is configured, **Ask AI** in the page actions opens the existing assis
4747

4848
Quiet maps its fonts, surfaces, borders and colors to the widget's public CSS variables. It also styles the floating button. Keep any product-specific questions and welcome message in your own configuration.
4949

50+
Messages, suggestions and the message input use 16px text. Supporting labels and code use 14px. Override individual variables in your site's stylesheet:
51+
52+
```css title="src/css/custom.css"
53+
biel-bot,
54+
biel-search {
55+
--biel-message-font-size: 16px;
56+
--biel-suggested-questions-font-size: 16px;
57+
--biel-text-font-size: 16px;
58+
}
59+
```
60+
5061
For another provider, keep its loader and controls in your site's configuration. Quiet does not replace the assistant's focus management, citations or access rules.
5162

5263
## Search

0 commit comments

Comments
 (0)