Skip to content

refactor(pr): type the session PR state - #1162

Open
lexoliu wants to merge 1 commit into
mainfrom
refactor/1161-pr-state
Open

lexoliu wants to merge 1 commit into
mainfrom
refactor/1161-pr-state

Conversation

@lexoliu

@lexoliu lexoliu commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

A session PR's state was a String from the prs row to the sidebar, matched against literals across pr.rs, the database layer, the daemon and the TUI, so a misspelt state compiled and matched nothing. PrState now carries it, stored and serialized under the same snake_case names so existing rows and the wire format are unchanged, with is_terminal, is_live and is_in_flight in place of each string match. pr list --state parses into PrFilter, where open keeps selecting every non-terminal PR, and the SQL that filtered on state lists now filters through the predicates.

Round-trip tests cover each stored string and its JSON; the pr, db, daemon, IPC, client and sidebar tests pass and clippy is clean with -D warnings.

Closes #1161

A session PR's state was a String from the prs row to the sidebar, compared
against literals in pr.rs, the database layer, the daemon and the TUI. PrState
now carries it, stored and sent under the same snake_case names, with
is_terminal, is_live and is_in_flight replacing each string match, and
pr list --state parses into PrFilter. No state string is left in SQL.

Closes #1161
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.

Session PR state is a string, not a type

1 participant