diff --git a/AGENTS.md b/AGENTS.md index f377e1ce..9b4dfd1b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -110,11 +110,12 @@ git push -u origin HEAD 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. -- **Short commits:** subject line + max 2 lines of body. Split into atomic commits - rather than writing long bodies. +**🚫 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. + +- **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`. - Bug fixes annotated inline: `// B7 (Jun 18 2026, kanban t_xxx): description`. diff --git a/app/src/main/java/com/m57/hermescontrol/NavigationController.kt b/app/src/main/java/com/m57/hermescontrol/NavigationController.kt index 378417e8..118c25f2 100644 --- a/app/src/main/java/com/m57/hermescontrol/NavigationController.kt +++ b/app/src/main/java/com/m57/hermescontrol/NavigationController.kt @@ -53,8 +53,17 @@ object NavigationController { 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 - if (stack.size > 1) stack.removeLastOrNull() + if (stack.size > 1) { + stack.removeLastOrNull() + } else if (stack.size == 1) { + stack.clear() + stack.add(fallback) + } } }