goBack() now uses ChatScreen as a fallback when the stack has only one item, preventing the Settings back-button crash. Co-authored-by: M57 <hy4ri@users.noreply.github.com>
This commit is contained in:
1 parent
62b1115924
commit
c6d7a45905
2 files changed
+16
-6
No files matched your search
@@ -110,11 +110,12 @@ git push -u origin HEAD
|
|||||||
gh pr create --title "fix(#N): description" --body "Closes #N"
|
gh pr create --title "fix(#N): description" --body "Closes #N"
|
||||||
```
|
```
|
||||||
|
|
||||||
### Commit Conventions
|
### Commit Conventions — STRICT
|
||||||
|
|
||||||
- **NO co-author trailer.** No `Co-Authored-By`, no `Generated with ...`. Ever.
|
**🚫 NEVER add yourself as author or co-author.** The agent must never appear in any commit metadata field — not as author, not as `Co-Authored-By`, not in `Generated with`, not anywhere.
|
||||||
- **Short commits:** subject line + max 2 lines of body. Split into atomic commits
|
|
||||||
rather than writing long bodies.
|
- **No `--author` override.** Use the default git config. Always.
|
||||||
|
- **Short commits:** subject line + max 2 lines of body. Split into atomic commits rather than writing long bodies.
|
||||||
- **Conventional Commits** types: `feat`, `fix`, `refactor`, `docs`, `test`, `ci`, `chore`.
|
- **Conventional Commits** types: `feat`, `fix`, `refactor`, `docs`, `test`, `ci`, `chore`.
|
||||||
- Bug fixes annotated inline: `// B7 (Jun 18 2026, kanban t_xxx): description`.
|
- Bug fixes annotated inline: `// B7 (Jun 18 2026, kanban t_xxx): description`.
|
||||||
|
|
||||||
|
|||||||
@@ -53,8 +53,17 @@ object NavigationController {
|
|||||||
backStack?.add(key)
|
backStack?.add(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun goBack() {
|
/**
|
||||||
|
* Navigate back one step, or fall back to [fallback] when the stack has only one item.
|
||||||
|
* Never leaves the stack empty.
|
||||||
|
*/
|
||||||
|
fun goBack(fallback: NavKey = ChatScreen) {
|
||||||
val stack = backStack ?: return
|
val stack = backStack ?: return
|
||||||
if (stack.size > 1) stack.removeLastOrNull()
|
if (stack.size > 1) {
|
||||||
|
stack.removeLastOrNull()
|
||||||
|
} else if (stack.size == 1) {
|
||||||
|
stack.clear()
|
||||||
|
stack.add(fallback)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user