Skip to content

Commit 150fe62

Browse files
jamesarichCopilot
andcommitted
feat(docs): add self-referential deep links from docs to app screens
- Add deepLink field to DocPage and KeywordIndexEntry models - Populate deep links for 7 user guide pages (connections, messages, nodes, map, settings, modules, firmware) - DocsLinkUriHandler now intercepts meshtastic:// URIs in markdown - DocsPageRouteScreen shows 'Open in App' button when deepLink is set - DocsNavigation wires onDeepLink through platform UriHandler - Add deep_link frontmatter field to 7 user doc pages - Update navigation-and-deep-links developer doc with full reference - Fix link validator to skip meshtastic:// URIs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c9c2f53 commit 150fe62

13 files changed

Lines changed: 108 additions & 9 deletions

File tree

docs/developer/navigation-and-deep-links.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,19 @@ meshtastic://meshtastic/{path}
5454

5555
| URI Path | Route | Notes |
5656
|----------|-------|-------|
57+
| `/connections` | `ConnectionsRoute.ConnectionsGraph` | Connections screen |
5758
| `/settings` | `SettingsRoute.SettingsGraph(null)` | Settings root |
59+
| `/settings/module-config` | `SettingsRoute.ModuleConfiguration` | Module config |
5860
| `/settings/helpDocs` | `SettingsRoute.HelpDocs` | Docs browser |
5961
| `/settings/helpDocs/{pageId}` | `SettingsRoute.HelpDocPage(pageId)` | Specific doc page |
6062
| `/settings/help-docs` | `SettingsRoute.HelpDocs` | Compatibility alias |
61-
| `/nodes` | `NodesRoute.Nodes` | Node list |
63+
| `/nodes` | `NodesRoute.NodesGraph` | Node list |
6264
| `/nodes/{destNum}` | `NodesRoute.NodeDetail(destNum)` | Node detail |
65+
| `/messages` | `ContactsRoute.ContactsGraph` | Conversation list |
6366
| `/messages/{contactKey}` | `ContactsRoute.Messages(contactKey)` | Conversation |
6467
| `/map` | `MapRoute.Map(null)` | Map view |
68+
| `/firmware` | `FirmwareRoute.FirmwareGraph` | Firmware screen |
69+
| `/channels` | `ChannelsRoute.ChannelsGraph` | Channel editor |
6570

6671
### Backstack Synthesis
6772

@@ -117,5 +122,46 @@ fun `help docs deep link routes correctly`() {
117122
}
118123
```
119124

125+
## Self-Referential Deep Links in Docs
126+
127+
User guide documentation pages can include a `deep_link` frontmatter field that maps the doc page to its corresponding app screen. When present, the in-app docs viewer shows an **"Open in App"** button in the top bar, allowing users to jump directly from documentation to the live feature.
128+
129+
### How It Works
130+
131+
1. The `deep_link` field in frontmatter specifies the target `meshtastic://` URI.
132+
2. `DocBundleLoader` populates `DocPage.deepLink` from the page definition.
133+
3. `DocsPageRouteScreen` renders a `TextButton` in the top app bar when `deepLink` is non-null.
134+
4. Tapping the button fires the URI through the platform `UriHandler`, which routes back through `UIViewModel.handleDeepLink()``DeepLinkRouter`.
135+
136+
### Pages with Deep Links
137+
138+
| Doc Page | Deep Link | Target Screen |
139+
|----------|-----------|---------------|
140+
| Connections | `meshtastic://meshtastic/connections` | Connections |
141+
| Messages & Channels | `meshtastic://meshtastic/messages` | Conversations |
142+
| Nodes | `meshtastic://meshtastic/nodes` | Node list |
143+
| Map & Waypoints | `meshtastic://meshtastic/map` | Map |
144+
| Settings — Radio & User | `meshtastic://meshtastic/settings` | Settings root |
145+
| Settings — Modules & Admin | `meshtastic://meshtastic/settings/module-config` | Module config |
146+
| Firmware Updates | `meshtastic://meshtastic/firmware` | Firmware |
147+
148+
### Adding a Deep Link to a Doc Page
149+
150+
1. Add `deep_link: meshtastic://meshtastic/{path}` to the page's YAML frontmatter.
151+
2. Add the matching `deepLink` parameter to the page's `UserPageDef` in `DocBundleLoader`.
152+
3. The in-app docs viewer picks up the deep link automatically — no further UI changes needed.
153+
154+
> **Note:** Deep links in frontmatter are ignored by Jekyll and Docusaurus, ensuring no broken links on external doc sites. The `meshtastic://` URI scheme is only active in-app.
155+
156+
### Inline Deep Links in Markdown
157+
158+
The `DocsLinkUriHandler` also intercepts `meshtastic://` URIs in markdown content. Authors can use inline deep links for contextual "try it now" actions:
159+
160+
```markdown
161+
Configure your LoRa preset in [Settings](meshtastic://meshtastic/settings/lora).
162+
```
163+
164+
These links only work in the in-app docs viewer. On Jekyll/Docusaurus, they render as non-functional links. Use sparingly and always provide equivalent text instructions.
165+
120166
---
121167

docs/user/connections.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Connections
33
nav_order: 2
44
last_updated: 2026-05-13
55
description: Connect your phone or desktop to a Meshtastic radio via Bluetooth, USB, or TCP/IP.
6+
deep_link: meshtastic://meshtastic/connections
67
aliases:
78
- bluetooth
89
- usb

docs/user/firmware.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Firmware Updates
33
nav_order: 13
44
last_updated: 2026-05-13
55
description: Update your radio firmware over Bluetooth — OTA process, version channels, pre-flight checks, and recovery.
6+
deep_link: meshtastic://meshtastic/firmware
67
aliases:
78
- firmware
89
- update

docs/user/map-and-waypoints.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Map & Waypoints
33
nav_order: 6
44
last_updated: 2026-05-13
55
description: View node positions on the map, create and share waypoints, and manage position sharing and privacy.
6+
deep_link: meshtastic://meshtastic/map
67
aliases:
78
- map
89
- waypoints

docs/user/messages-and-channels.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Messages & Channels
33
nav_order: 3
44
last_updated: 2026-05-13
55
description: Send and receive messages, manage channels, configure encryption, and use quick chat, reactions, and message actions.
6+
deep_link: meshtastic://meshtastic/messages
67
aliases:
78
- channels
89
- direct-messages

docs/user/nodes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Nodes
33
nav_order: 4
44
last_updated: 2026-05-13
55
description: Browse, filter, and sort mesh nodes — view details, signal quality, roles, and quick actions.
6+
deep_link: meshtastic://meshtastic/nodes
67
aliases:
78
- node-list
89
- mesh-nodes

docs/user/settings-module-admin.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Settings — Modules & Admin
33
nav_order: 8
44
last_updated: 2026-05-13
55
description: Configure optional feature modules (MQTT, telemetry, canned messages, TAK, and more) and perform device administration.
6+
deep_link: meshtastic://meshtastic/settings/module-config
67
aliases:
78
- modules
89
- module-config

docs/user/settings-radio-user.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Settings — Radio & User
33
nav_order: 7
44
last_updated: 2026-05-13
55
description: Configure your radio hardware, LoRa presets, user profile, position sharing, power management, and security.
6+
deep_link: meshtastic://meshtastic/settings
67
aliases:
78
- settings
89
- radio-config

feature/docs/src/commonMain/kotlin/org/meshtastic/feature/docs/data/DocBundleLoader.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ class DefaultDocBundleLoader : DocBundleLoader {
156156
val aliases: List<String>,
157157
val charCount: Int,
158158
val iconId: String,
159+
val deepLink: String? = null,
159160
)
160161

161162
@Suppress("MagicNumber")
@@ -180,6 +181,7 @@ class DefaultDocBundleLoader : DocBundleLoader {
180181
listOf("bluetooth", "usb", "tcp", "pairing"),
181182
4100,
182183
"connections",
184+
deepLink = "meshtastic://meshtastic/connections",
183185
),
184186
UserPageDef(
185187
"messages-and-channels",
@@ -190,6 +192,7 @@ class DefaultDocBundleLoader : DocBundleLoader {
190192
listOf("channels", "direct-messages", "messaging", "conversations"),
191193
4500,
192194
"messages",
195+
deepLink = "meshtastic://meshtastic/messages",
193196
),
194197
UserPageDef(
195198
"nodes",
@@ -200,6 +203,7 @@ class DefaultDocBundleLoader : DocBundleLoader {
200203
listOf("node-list", "mesh-nodes", "peers"),
201204
3800,
202205
"nodes",
206+
deepLink = "meshtastic://meshtastic/nodes",
203207
),
204208
UserPageDef(
205209
"node-metrics",
@@ -220,6 +224,7 @@ class DefaultDocBundleLoader : DocBundleLoader {
220224
listOf("map", "waypoints", "gps", "location"),
221225
3600,
222226
"map",
227+
deepLink = "meshtastic://meshtastic/map",
223228
),
224229
UserPageDef(
225230
"settings-radio-user",
@@ -230,6 +235,7 @@ class DefaultDocBundleLoader : DocBundleLoader {
230235
listOf("settings", "radio-config", "user-config", "lora"),
231236
6800,
232237
"settings-radio",
238+
deepLink = "meshtastic://meshtastic/settings",
233239
),
234240
UserPageDef(
235241
"settings-module-admin",
@@ -240,6 +246,7 @@ class DefaultDocBundleLoader : DocBundleLoader {
240246
listOf("modules", "module-config", "administration"),
241247
5500,
242248
"settings-module",
249+
deepLink = "meshtastic://meshtastic/settings/module-config",
243250
),
244251
UserPageDef(
245252
"telemetry-and-sensors",
@@ -290,6 +297,7 @@ class DefaultDocBundleLoader : DocBundleLoader {
290297
listOf("firmware", "update", "ota", "flash"),
291298
3400,
292299
"firmware",
300+
deepLink = "meshtastic://meshtastic/firmware",
293301
),
294302
UserPageDef(
295303
"desktop",
@@ -344,6 +352,7 @@ class DefaultDocBundleLoader : DocBundleLoader {
344352
aliases = def.aliases,
345353
charCount = def.charCount,
346354
iconId = def.iconId,
355+
deepLink = def.deepLink,
347356
)
348357
}
349358

@@ -464,5 +473,6 @@ class DefaultDocBundleLoader : DocBundleLoader {
464473
aliases = aliases,
465474
charCount = charCount,
466475
iconId = iconId,
476+
deepLink = deepLink,
467477
)
468478
}

feature/docs/src/commonMain/kotlin/org/meshtastic/feature/docs/model/DocModels.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ data class DocPage(
6161
val charCount: Int,
6262
/** Icon identifier for TOC display (maps to MeshtasticIcons). */
6363
val iconId: String? = null,
64+
/** Deep link URI to open the corresponding app screen (e.g. `meshtastic://meshtastic/nodes`). */
65+
val deepLink: String? = null,
6466
)
6567

6668
/** Content wrapper that decouples metadata from rendered content. */
@@ -92,6 +94,7 @@ data class KeywordIndexEntry(
9294
val aliases: List<String> = emptyList(),
9395
val charCount: Int,
9496
val iconId: String? = null,
97+
val deepLink: String? = null,
9598
)
9699

97100
/** Normalized user search query. */

0 commit comments

Comments
 (0)