diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-02 20:46:29 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-02 20:46:29 +0100 |
| commit | 52b0b86ce7430118ab988f784d6422ff8b780c93 (patch) | |
| tree | 03c2cdb4a59eb8d67de530a9b16512b41bcdac13 /ui/compose/src/main | |
| parent | 69e42da191f4c1596e282cfc31cd3a58ae263de1 (diff) | |
| download | HardenedPass-52b0b86ce7430118ab988f784d6422ff8b780c93.tar.gz HardenedPass-52b0b86ce7430118ab988f784d6422ff8b780c93.zip | |
feat(ui-compose): add the breadcrumb model
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'ui/compose/src/main')
| -rw-r--r-- | ui/compose/src/main/kotlin/app/passwordstore/ui/compose/Breadcrumbs.kt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ui/compose/src/main/kotlin/app/passwordstore/ui/compose/Breadcrumbs.kt b/ui/compose/src/main/kotlin/app/passwordstore/ui/compose/Breadcrumbs.kt new file mode 100644 index 00000000..d8bc02fe --- /dev/null +++ b/ui/compose/src/main/kotlin/app/passwordstore/ui/compose/Breadcrumbs.kt @@ -0,0 +1,16 @@ +/* + * Copyright (C) 2026 Danilo M. <danix@danix.xyz> + * SPDX-License-Identifier: GPL-3.0-only + */ + +package app.passwordstore.ui.compose + +/** One breadcrumb chip. The root crumb has an empty [label] and [path]. */ +public data class Crumb(val label: String, val path: String) + +/** Crumbs for a folder at [relativePath] inside the store: root first, then each level. */ +public fun crumbsFor(relativePath: String): List<Crumb> { + val parts = relativePath.split('/').filter { it.isNotEmpty() } + return listOf(Crumb("", "")) + + parts.indices.map { i -> Crumb(parts[i], parts.subList(0, i + 1).joinToString("/")) } +} |
