Skip to content

Break up lib.rs #330

@wesbillman

Description

@wesbillman

lib.rs is doing too much. It holds 23 #[tauri::command] handlers, timeline-building logic, diff computation, helper structs, and app setup. The project has already started extracting commands into focused modules (project_commands.rs, session_commands.rs, actions/commands.rs), but the majority still live in lib.rs. Natural extraction targets:

Timeline commands & logic → timeline_commands.rs — build_branch_timeline, get_branch_timeline, and the BranchTimeline/*TimelineItem structs
Diff commands & helpers → diff_commands.rs — BranchDiffContext, resolve_branch_context, build_diff_spec, build_remote_diff_refs, parse_name_status_z, get_diff_files, get_file_diff, get_file_at_ref
Review commands → review_commands.rs — review CRUD, mark/unmark reviewed, comment/reference management
Git utility commands → could live in git/commands.rs — list_branches, detect_default_branch, prune_refs, list_prs, list_issues
"Open In" / misc utility commands → utility_commands.rs — open_url, open_directory_in_app, check_sq_available, read_text_file
This follows the pattern already established by the existing extracted modules and aligns with the project hint: "Keep src/lib code files smaller and organized by responsibility."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions