Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 18, 2025

Rewrite Lazy TUI to Use New But APIs

Completed

  • Added lazy TUI module to the but crate
  • Updated imports to use but_api::legacy instead of direct gitbutler_* imports
  • Replaced CommandContext with but_ctx::Context throughout
  • Updated method calls to use new Context API (Context::new_from_legacy_project)
  • Fixed AppSettings method name to load_from_default_path_creating_without_customization
  • Added crossterm and ratatui dependencies to but crate
  • Updated FileAssignment::from_assignments to use IdMap parameter
  • Fixed module path for status::assignment (now command::legacy::status::assignment)
  • Added Lazy command to CLI args
  • Integrated lazy TUI into lib.rs command handling
  • Added metrics support for Lazy command
  • Code compiles successfully with legacy features

TODO/Known Issues

  • get_commit_changes is stubbed - needs implementation using but-core's commit change APIs
  • Upstream info loading is disabled - needs to be fixed with new Context API
  • Some secondary features may not work fully due to API migration
  • Test the lazy TUI functionality end-to-end

Changes Made

The lazy TUI has been updated to work with the current master branch APIs:

  • Uses but_ctx::Context instead of the removed CommandContext
  • Calls legacy APIs through but_api::legacy namespace
  • Compatible with the new graph-based workspace model
  • Most core functionality (status, commits, branches, oplog) should work
  • Some features (commit diff modal, upstream info) are temporarily disabled pending full API implementation
Original prompt

rewrite this PR on top of the current master branch, using the new but apis. look at recent commits to the but crate to see what the new api styles are.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link

vercel bot commented Dec 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
gitbutler-web Ignored Ignored Preview Dec 22, 2025 10:51am

Comment on lines 63 to 82
generate-ts-definitions:
needs: changes
if: ${{ needs.changes.outputs.node == 'true' || needs.changes.outputs.rust == 'true' }}
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Rust Cache
uses: Swatinem/rust-cache@v2.8.2
with:
shared-key: ts-def-gen
save-if: ${{ github.ref == 'refs/heads/master' }}
# Node is needed for the formatting of typescript files.
- uses: ./.github/actions/init-env-node
- name: Dependencies for 'keyring'
run: sudo ./scripts/install-minimal-debian-dependencies.sh
- run: ./scripts/generate-ts-definitions-from-rust.sh

Check warning

Code scanning / zizmor

overly broad permissions Warning

overly broad permissions
@schacon schacon force-pushed the copilot/rewrite-pr-with-new-but-api branch 2 times, most recently from 9be65e7 to 9cac379 Compare December 18, 2025 13:13
@schacon schacon changed the base branch from sc-cursor-lazybut to master December 19, 2025 09:32
@schacon schacon changed the title [WIP] Rewrite PR using new but APIs from master branch [WIP] gitbutler tui Dec 19, 2025
@schacon schacon force-pushed the copilot/rewrite-pr-with-new-but-api branch 2 times, most recently from 02e5c9a to e6f213e Compare December 22, 2025 10:47
@schacon schacon force-pushed the copilot/rewrite-pr-with-new-but-api branch from e6f213e to 3f7166d Compare December 22, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants