Skip to content

Conversation

@luqven
Copy link
Owner

@luqven luqven commented Dec 29, 2025

Summary

Add identifier detection and interactive prompts for the smart-default log command.

Changes

New file: src/identifier.rs

  • StackSummary - Display info for a stack (branch, PR count, numbers, title snippet)
  • is_trunk_branch() - Check if branch is a trunk (main, master, develop, etc.)
  • detect_trunk_branch() - Get default branch from git remote via git remote show origin
  • TrunkAction enum - User choices when on trunk (enter identifier, select stack, cancel)
  • prompt_trunk_action() - Interactive menu when user is on trunk branch
  • prompt_select_stack() - Let user pick from a list of detected stacks
  • prompt_identifier() - Manual identifier entry prompt

Modified: src/lib.rs

  • Export new identifier module

Tests

12 new unit tests:

  • test_is_trunk_branch_* - Various trunk detection scenarios
  • test_stack_summary_* - Summary creation and display formatting

Stacked PR Chain: smart-log

PR Title Merges Into
#35 feat: add stack discovery API -
#36 feat: add rate limit retry logic #35
#37 👉feat: add identifier detection and prompts #36
#38 feat: add gh CLI helpers #37
#39 feat: make log and status identifier optional with branch inference #38
#40 docs: update log and status documentation for smart defaults #39
#41 perf: optimize stack discovery with batch fetch #40
#42 perf: parallelize status check fetches #41

Add src/identifier.rs module for trunk branch detection and
interactive stack selection prompts.

New types and functions:
- StackSummary: Display info for a stack (branch, PR count, numbers)
- is_trunk_branch(): Check if branch is a trunk (main, master, etc.)
- detect_trunk_branch(): Get default branch from git remote
- TrunkAction: Enum for user choices when on trunk
- prompt_trunk_action(): Interactive menu for trunk branch
- prompt_select_stack(): Let user pick from stack list
- prompt_identifier(): Manual identifier entry

Includes 12 unit tests for trunk detection and summary formatting.
@luqven
Copy link
Owner Author

luqven commented Dec 30, 2025

Landed via #42

@luqven luqven closed this Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants