Commit Graph

655 Commits

Author SHA1 Message Date
Chooooooo
f178c4fed4
Update read_file_from_workspace logic
- Refactor `read_file_from_workspace` to separate `HEAD^{tree}` lookup logic
- Add new `read_file_from_tree` function to handle both `HEAD^{tree}` and specific commit lookups
- Add edge case handling for querying files from a specific commit in `read_file_from_workspace`
- Add conditions to handle modified or deleted files in worktree
- Improve file status handling with new `FileStatus` enum
- Update `FileInfo` struct to include file status information
2024-10-15 21:26:39 +09:00
Pavel Laptev
4d84a87f5c
Fix button type for modals (#5145) 2024-10-15 14:19:00 +02:00
Ali Houssain Sareini
f96f1ae2c3 refactor: Display selected code editor over generic Editor 2024-10-15 08:02:34 -04:00
Ali Houssain Sareini
08bd7f7129 added support for new default editor type in settings 2024-10-15 08:01:53 -04:00
Ali Houssain Sareini
f53a232052 fix lint error 2024-10-15 07:37:29 -04:00
Ali Houssain Sareini
8779cce0da rename openInVSCode to openInEditor 2024-10-15 07:37:14 -04:00
Ali Houssain Sareini
475975b0f4 added CodeEditorSettings type in settings 2024-10-15 07:35:03 -04:00
Pavel Laptev
62ffe0986d
Revert dialog modal implementation (#5143)
* rename `default` size to `medium`

* animation on close and focus trap

* focus trap fix

* fix clickoutside bug with open select

* Update focusTrap.ts

* fix check

* remove unnesessery code
2024-10-15 10:45:09 +02:00
Ali Houssain Sareini
ce3e718d29 revert BranchLaneContents removal in settings 2024-10-14 20:22:43 -04:00
Ali Houssain Sareini
e3c493a060 refactor: replace VSCode with generic editor 2024-10-14 20:05:07 -04:00
Ali Houssain Sareini
28fa6720b3 refactor: Update code editor paths to use editor from userSettings 2024-10-14 19:43:38 -04:00
Ali Houssain Sareini
0d0652c351 feat(ui): Add default code editor to settings/appearance 2024-10-14 19:43:15 -04:00
Ali Houssain Sareini
2394f38b9b refactor(settings): Add default code editor settings 2024-10-14 19:42:26 -04:00
Chooooooo
e789eb1a55
Add preview support for untracked binary files 2024-10-15 03:31:28 +09:00
Caleb Owens
22daef3681
Merge pull request #5136 from gitbutlerapp/Update-how-auth-tokens-are-passed-about
Update how auth tokens are passed about
2024-10-14 18:29:04 +02:00
Caleb Owens
5f49663265 Update how auth tokes are passed around
I forgot to run pnpm check
I forgot to run pnpm test
2024-10-14 17:31:02 +02:00
Chooooo
b4c84fdfd8
Merge branch 'master' into feat/parse-binary-file 2024-10-15 00:07:28 +09:00
ndom91
c5efb7f246 fix: dont show 'set remote branch name' option in stack header contextMenu 2024-10-14 16:40:45 +02:00
Pavel Laptev
ba2d95a338
style: button color updates (#5134) 2024-10-14 15:42:55 +02:00
Nico Domino
88611b6ab5 fix: layout updates 2024-10-14 15:40:47 +02:00
ndom91
f2fffce255 feat: add additional feature flag to disable adding multiple series within a stack 2024-10-14 15:40:47 +02:00
ndom91
5e7e87cab1 fix: hide commitList if there are no commits 2024-10-14 15:37:33 +02:00
ndom91
49a4f2581f fix: do not show upstream label when branch has not been pushed yet 2024-10-14 15:03:32 +02:00
Pavel Laptev
3fdc4d1b1e
UI: PR card tweaks (#5131)
* add tooltips

* fix kebaba size and margins
2024-10-14 14:49:54 +02:00
Esteban Vega
fdd64015b7
Merge pull request #5110 from gitbutlerapp/fix-histroy-pagination
fix: History lazy loading
2024-10-14 14:15:53 +02:00
ndom91
90ae4eccd9 fix: dont allow changing series name once pushed 2024-10-14 13:48:07 +02:00
ndom91
5724136e88 fix: change stacking header line alignment 2024-10-14 12:29:37 +02:00
Pavel Laptev
1b8cfd2723
Merge pull request #5126 from gitbutlerapp/Fix-remove-sidebar-focus-state
feat: Remove tabindex attribute from Navigation menu
2024-10-14 11:56:25 +02:00
Pavel Laptev
2797afd5c0 clear the AI description body after generation 2024-10-14 11:43:09 +02:00
Pavel Laptev
cf08814bee feat: Remove tabindex attribute from Navigation menu 2024-10-14 11:32:56 +02:00
Esteban Vega
ae283c4a65
Merge pull request #5123 from gitbutlerapp/fix-state-update-for-PR-modal-title
fix: Title state update for the PR modal
2024-10-14 11:28:17 +02:00
Pavel Laptev
c7342b1cdf
Integration modal design (#5116)
* new IntegrationListItem component

* Simple commit row added, componenets rename

* Tweak styles and `Select` update

* check fix
2024-10-14 11:10:00 +02:00
estib
e65fd1c947 fix: State update for the PR modal
The PR modals title would only be correctly updated on blur, because it was using the 'onchange' listener.
Using the 'oninput' listener fixed that.
Also: 
Only fetch the pull-request body if the modal is open
2024-10-14 10:52:52 +02:00
Esteban Vega
49a88430a2
Merge pull request #5048 from Pranav2612000/feat/4889-allow-moving-any-commit-from-stack-to-lane
[#4889] feat: allow moving any commit from a stack into another lane
2024-10-14 09:10:23 +02:00
estib
9bf6ef7995 fix: History lazy loading
Lazy loading the history side bar list items wouldn't paginate correctly.
There seems to have been two issues that caused this:
1. The intersection observer would was not initially set correctly
2. The "all loaded" flag was incorrectly set to true when clearing the history snapshots store. It should have been set to false.
2024-10-11 19:07:06 +02:00
ndom91
373ba6036e fix: add emptystateplaceholder to series header empty state
fix: update StackingBranchHeader with empty state
fix: empty state marginBottom: 10
2024-10-11 19:05:26 +02:00
ndom91
b86e171e8c fix: rename series title 2024-10-11 18:45:17 +02:00
ndom91
a38c3cc5c1 fix: always show gap on stackingstatusicon and use border radius css variable 2024-10-11 17:03:03 +02:00
estib
f71187ed05 feat: allow moving any commit from a stack into another lane
Rebasing fixes
2024-10-11 15:06:55 +02:00
Caleb Owens
316dd8d2b6 Extract persisted into a shared library 2024-10-11 11:55:07 +02:00
ndom91
902b6526bf fix: refactor historyViewToggle and add ctrl+z alias keyboard shortcut 2024-10-10 17:42:14 +02:00
Pavel Laptev
56d0fe44c8
"unnaply and drop changes" update copy, update modals UI and layout (#5092)
* update copy, update modals UI and layout

* Update BranchLaneContextMenu.svelte
2024-10-10 14:39:07 +00:00
Caleb Owens
d2034e1a5d Move context into shared 2024-10-10 15:57:16 +02:00
Caleb Owens
5b8c37f830 Move httpService into shared library 2024-10-10 15:31:17 +02:00
ndom91
8769d7c8ac fix: check stackingFeature to determine which alg to use for assigning 'localAndRemote' commit status 2024-10-10 15:43:11 +02:00
Chooooo
59513b8d99
Merge branch 'master' into feat/parse-binary-file 2024-10-10 19:52:42 +09:00
Chooooooo
a6ff493673
Code formatting 2024-10-10 19:40:06 +09:00
ndom91
9e27fea94e fix: only set upstreamName if upstreamReference exists 2024-10-10 12:31:13 +02:00
ndom91
fef2865469 fix: branch header bottom border when PR card isnt there 2024-10-10 12:31:13 +02:00
ndom91
8fa6bfc152 fix: hide upstream related btns if stack/series hasn't been pushed yet 2024-10-10 12:31:13 +02:00
Chooooooo
3c9eb56a37
Add parsing for binary files 2024-10-10 19:04:36 +09:00
Esteban Vega
979b5620a1
Merge pull request #5087 from gitbutlerapp/fix-Set-the-system-prompt-separately
fix: Set the system prompt for Anthropic
2024-10-10 11:59:42 +02:00
Caleb Owens
c46eb573a9
Merge pull request #5079 from gitbutlerapp/Add-a-shared-package
Add a shared package
2024-10-10 11:52:15 +02:00
estib
9e2e13ae82 fix: Set the system prompt for Anthropic
The System Prompt for Anthropic needs to be set in a separate field.
Split that as well when using Anthropic through the Butler AI API.
2024-10-10 11:50:15 +02:00
ndom91
4e051e16ed fix: status icon for series header 2024-10-10 11:12:53 +02:00
ndom91
89f630e7b3 fix: inline updating of series name 2024-10-10 11:10:24 +02:00
Mattias Granlund
27c23c7627 Capture stack usage metrics 2024-10-10 10:50:56 +02:00
Kiril Videlov
03247b7e22
Merge pull request #5082 from gitbutlerapp/more-pr-details-followups
Conflict Resolution: Add a confirmation modal
2024-10-10 10:37:45 +02:00
estib
936ec01e8f Conflict Resolution: Add a confirmation modal
If attempting to resolve conflicts on non-acestor-most commits, the user will be prompted to confirm whether they actually want that or not.
2024-10-10 10:30:29 +02:00
estib
31f929269f fix: Commit Input: Update the typing of the text areas
Update the typing of the text areas components inside the commit message input component.
Also add guards against them being undefined
2024-10-10 10:14:41 +02:00
Esteban Vega
857cf7816c
More PR details follow-ups (#5073)
- Add a dedicated 'open PR in browser' button
- Fix the description generation in the modal
2024-10-10 00:02:01 +02:00
Caleb Owens
eead534ab7 Add a shared package 2024-10-09 23:06:31 +02:00
Esteban Vega
e28a4b697c
Merge pull request #5069 from gitbutlerapp/user-mail-is-optional 2024-10-09 22:50:00 +02:00
ndom91
95767ab474 fix: rm 'create branch'/'push ref' btns from stacking commit card 2024-10-09 21:44:20 +02:00
ndom91
ebcfa9f9a0 fix: harmonize commitStatus types and ensure correct color commitCard and branchHeader are rendered
fix: eslint
2024-10-09 21:44:20 +02:00
ndom91
6e631d8ea4 fix: correctly color branch header 2024-10-09 21:44:20 +02:00
ndom91
b4deaae012 fix: do not group commits in stacking mode series rendering 2024-10-09 21:44:20 +02:00
ndom91
3a642c750f fix: pass only 'upstreamPatches' and 'patches' from the current series to commitList 2024-10-09 21:44:20 +02:00
Caleb Owens
5071cc40ff LIst conflicted files in commit files list 2024-10-09 20:21:57 +02:00
Caleb Owens
3ba4261599 Commit uncommit 2024-10-09 19:35:05 +02:00
Kiril Videlov
3978476b78 Add an extra field remote_commit_id on the API type VirtualBranchCommit
This makes it possibe (and easy) for the UI to determine if there is another (different) commit on the remote for the same patch
2024-10-09 18:15:10 +02:00
Pavel Laptev
e05c1a4a08
Move dummy UI and minor code refactor (#5061)
* update: storybook styles

* fix: Link button prop

* move borderless textarea to UI

* add: BorderlessTextarea story

* remove unused `autoHeight`

* simplify "Props" names

* migrate to Svelte 5: EmptyState component

* fix: autofocus when open the branches search

* eslint

* lint fixes

* lint fixes

---------

Co-authored-by: estib <stron@me.com>
2024-10-09 17:00:35 +02:00
Nico Domino
531cbde1ff
fix: stackingCommitList reorder-dropzone and "add empty commit" btn rendering (#5066) 2024-10-09 16:59:37 +02:00
estib
8860622ff4 User: Make email optional
When authenticating with some IdPs, email doesn't get shared.
In that case, trying to authenticate would just throw a Rust-end error to the users.
This fixes that
2024-10-09 16:43:00 +02:00
ndom91
7858230812 fix: disable deleting series if there is only 1 2024-10-09 15:39:58 +02:00
ndom91
e5fbb18883 fix: reorient new series name modal action btns 2024-10-09 15:39:58 +02:00
Caleb Owens
82b58b6875 Make edit mode fantastic 2024-10-09 15:27:20 +02:00
Caleb Owens
39f9f50296 Float unconflicted files in edit mode 2024-10-09 11:21:51 +02:00
Caleb Owens
12782d5229
Merge pull request #5000 from gitbutlerapp/pr-5000
FEARLESS REBASING
2024-10-08 16:49:51 +02:00
Esteban Vega
72e981f8cc
pr details follow up (#5054)
* PR Details: CMD or Ctrl + Click opens the browser

* Segment: Optionally make it unfocusable

Control whethe the segment can be focused on tab, or not

* PR Details: Remove unused 'e' handler

* Borderless Textarea: Ability to autofocus

Optionally, autofocus the input field on mount

* PR Details: Update focus behavior

- Focus on the title input filed on mount
- Make the segments unfocusable

* design update

* Update PrDetailsModal.svelte

---------

Co-authored-by: Pavel Laptev <pawellaptew@gmail.com>
2024-10-08 15:50:43 +02:00
Caleb Owens
45fbb1af76 Remove old update_base_branch code 2024-10-07 17:46:28 +02:00
Caleb Owens
2f33d618d5 Remove succeeding rebase flag from the frontend 2024-10-07 17:31:08 +02:00
Pavel Laptev
f6621ba4d5 copy update 2024-10-07 14:33:22 +02:00
estib
efcfe0954e PrDetailsModal: Display the actualy body
- Display the actual body value
- Generate the message on `shift` + `cmd` + g
2024-10-07 14:14:38 +02:00
estib
455d67fb86 Prettier fixing 2024-10-07 14:07:20 +02:00
Pavel Laptev
5ec15fcf26 fixes
- return accidentally deleted code
- pr card layout and copy updated
2024-10-07 13:48:20 +02:00
Pavel Laptev
afc270b561 copy update 2024-10-07 13:20:11 +02:00
Pavel Laptev
8cfee0328a update PR tags 2024-10-07 13:10:35 +02:00
Pavel Laptev
d33da1c868 "Update" button update
- move the button position
- don't disable the "update" button if checks are loading
2024-10-07 12:34:12 +02:00
Pavel Laptev
54f7059aa6 update PR card design 2024-10-07 12:30:41 +02:00
Pavel Laptev
96e9e7b3bb added custom scrollbar component 2024-10-07 12:07:04 +02:00
Pavel Laptev
06bd38af5d fix: pr description scroll 2024-10-07 11:52:48 +02:00
Pavel Laptev
59b73c7c07 new PR layout 2024-10-06 19:10:37 +02:00
Pavel Laptev
effe3fcb78 Update "Enable PR templates" settings section
- simplify title
- updated section states when empty and disabled
- update and move `EmptyStatePlaceholder` into UI package
2024-10-04 15:44:07 +02:00
estib
718fa8d2ff Stack Headers: Use new PR button
The new PR headers use the new PR details modal
2024-10-04 14:22:25 +02:00
Pavel Laptev
e2e5ec579e disable lane outline on modal close 2024-10-04 11:15:36 +02:00
Pavel Laptev
210b58d8f8 fix: DefaultTargetButton size for the stacking feature 2024-10-04 10:56:48 +02:00
estib
a2d2ebdf07 PullRequestCard: Move the PR details button to the title 2024-10-04 09:35:19 +02:00
estib
9230c998af PrDetailsModal: Keyboard shortcuts
Meta or Ctrl + e - Toggle the edit mode
Meta or Ctrl + g - Generate a description using the default prompt
Meta or Ctrl + Enter - Create the PR
2024-10-04 09:34:31 +02:00
estib
9dcbf8b756 PRDetailsModal: Don't fetch the PR template if no path is given 2024-10-03 14:01:08 +02:00
estib
7b71f40b7b PRDetailsModal: Add tab indexes 2024-10-03 14:00:03 +02:00
estib
17d8ef8428 PRDetailsModal: Update the preferred PR action
Move the ability to select whether to create a Draft PR or a normal one to the Details modal
2024-10-03 13:27:19 +02:00
estib
494a87bd5a ai: Generate or edit the PR description
Add the ability to generate the PR description out of the commit descriptions + an optional user prompt
2024-09-30 10:09:54 +02:00
estib
f442195769 Create PR preview: Edit the PR contents
Add the ability to edit the text contents of a PR before creating it.

Also, integrate the variants into one component
2024-09-26 13:33:21 +02:00
estib
215af9fc79 Hotkeys: Ctrl or Cmd + Enter
Add an utility to easily create the callback binding to an enter + ctrl or cmd in a component
2024-09-30 10:04:58 +02:00
estib
29b37f5cab Create PR preview
When creating a PR, display a preview of the title and body to confirm with the user
2024-09-26 10:19:47 +02:00
estib
108533777e PullRequestCard: 'View details' button
Add a button to the PR card that shows a Modal with the PR details
2024-09-25 17:19:04 +02:00
Esteban Vega
4137b31a5c
Merge pull request #5051 from gitbutlerapp/enable-string-error-toasts
improvement: Allow for string error toasts
2024-10-07 13:36:00 +02:00
estib
83738f35f6 improvement: Allow for string error toasts
Passing a string as the error to be displayed in the toast will display it as is
2024-10-07 12:18:42 +02:00
estib
37f75061c8 small-fix: Update the typing of the context menu variable
Compliant with the Svelte linter rules
2024-10-07 09:49:21 +02:00
estib
e27769077d IntegrateUpstreamModal: Update style
Update the style of the integrate upstream modal to:
- Differentiate between base-branch divergence
- Virtual branch states & resolutions

Also:
- Uncomment the option to create a merge commit to resolve the base-branch divergence
2024-10-05 10:18:06 +02:00
estib
d8b2bee18c fix: Lint errors 2024-10-04 10:35:17 +02:00
estib
9834627a20 Base: Propagate the conflicting status to the commits 2024-09-25 14:34:10 +02:00
estib
1368d87ed0 Base branch divergence resolution
Allow the user to choose how to resolve the base-branch divergence
2024-09-25 14:05:04 +02:00
estib
2091025227 Resolve upstream integration
Add a method to determine which should be the new base branch target commit ID based on what resolution approach is selected
2024-09-24 17:16:26 +02:00
estib
e4cd357b8a BaseBranch: Handle the button actions correctly
Depending on which action the user chooses, and whether they've set certain flags, act accordingly
2024-09-24 15:18:47 +02:00
estib
78d40a7493 BaseBranch: Don't be scary when pushing
Only display the warnings and confirmation modals when actual changes can get lost (resting to local or remote).
Otherwise, display less scary notifications and let the user push if needed

Merge remote-tracking branch 'origin/master' into base-branch-improvements
2024-09-24 14:06:49 +02:00
estib
9060a4287c Ability to push the base branch
If needed, the base branch can be pushed or force pushed
2024-09-24 14:06:05 +02:00
estib
2be4aaac2d Display the divergent state in the app
If the local target has diverged from the remote target, display that to the user as a warning

Only show either the divergence warning or upstream count
BaseBranch: Use runes

BaseBranch: Display the branch graph

In order to make it a bit clearer what the divergence state of the base branch is. reuse the line graphs to display it

BaseBranch divergence: Add a confirmation modal
2024-09-24 14:06:03 +02:00
estib
19acb8f22c Array utils: group items by condition 2024-09-24 14:02:32 +02:00
estib
3a2cf73bcd BaseBranch: Determine whether the base diverged
Determine whether the local target has diverged from the remote,
and return some information about that
2024-09-24 13:57:22 +02:00
Nico Domino
77c6529688
fix: use showStackingDetails persisted writable instead of function import (#5042) 2024-10-04 18:36:24 +02:00
Nico Domino
1d4f5f6762
fix: upstream commits accordion and cards (#5044) 2024-10-04 15:42:04 +00:00
estib
c6f19bc1ff fix: Correctly update the zoom from the settings 2024-10-04 16:00:19 +02:00
Mattias Granlund
c951f01c98 Fix lint errors 2024-10-04 12:43:26 +02:00
Mattias Granlund
3b1725cfc4 Add key to #each over patch series
- prevents funny things from happening
2024-10-04 12:43:26 +02:00
ndom91
4c2fe5929a fix: branch header dynamic title size 2024-10-04 12:43:26 +02:00
Mattias Granlund
eede90ac96 Fix rebasing commits between stacked series 2024-10-04 12:43:26 +02:00
Mattias Granlund
80d8182ecb Add prompt for patch series name
- new prompt when adding blank group
- aligned with prompt when adding group to existing commit
2024-10-04 12:43:26 +02:00
Mattias Granlund
ae1efad769 Fix: link related commits found in new series data 2024-10-04 12:43:26 +02:00
Mattias Granlund
5e326710c7 Rename "Add ref" to "Add branch" 2024-10-04 12:43:26 +02:00
Mattias Granlund
5c26def86b Improve stack header dropdown 2024-10-04 12:43:26 +02:00
Mattias Granlund
25fad4f376 Implement backend call for "rename series" 2024-10-04 12:43:26 +02:00
Mattias Granlund
a43523d157 Fix: send correct name when creating a series 2024-10-04 12:43:26 +02:00
Mattias Granlund
490febec5c Implement backend call for "remove series" 2024-10-04 12:43:26 +02:00
Mattias Granlund
3eaa991385 Fix the new series button at the top 2024-10-04 12:43:26 +02:00
Mattias Granlund
31f5bb38c9 Make push button sticky in stacking mode 2024-10-04 12:43:26 +02:00
Mattias Granlund
4f2291e37c Fix: state_unsafe_mutation workaround
An alternative fix would be to initialise the loading store at first load in order to avoid changing it immediately on `start()`, that's what causes the error.
2024-10-04 12:43:26 +02:00
Mattias Granlund
548263e538 Use correct branch names, prs etc for a patch series
- create pr button not working entirely, something to do with ref not being pushed
2024-10-04 12:43:26 +02:00
ndom91
2bba8cbae6 fix: stackingCommitCard and handle remoteRef:null in groupCommitsByRef 2024-10-04 12:43:26 +02:00
ndom91
979ed50510 feat: match stackingBranchHeader and statusIcon colors to top commit 2024-10-04 12:43:26 +02:00
ndom91
b46c397c60 feat: add StackingBranchHeader contextMenu and handlers for contextMenuItems as well as their Modals 2024-10-04 12:43:26 +02:00
ndom91
9ba5ecbf65 feat: add openExternalBranch iconButton 2024-10-04 12:43:26 +02:00
ndom91
2af2e34bc0 feat: finish implementing upstream commits accordion 2024-10-04 12:43:26 +02:00
Mattias Granlund
8bdeb3f635 Cleanup experimental stacking feature
- initial "new stacking branch" card
- persist setting for show stacking details
- separates out individual branch / pr header
- stack files in separate folder
- implements upstream commits accordion
2024-10-04 12:43:26 +02:00
estib
94fa0fed5d fix: Update the type of the drop down button
Fix up the type of variable used to refernce the drop down button in the PR button component
2024-10-03 11:58:01 +02:00
Pavel Laptev
47c0bad9ac
fix: diff example "added/deleted" lines (#5023) 2024-10-03 00:22:00 +02:00
Esteban Vega
c4fc0923ce
Merge pull request #5017 from gitbutlerapp/add-scroll-area-to-the-edit-mode
Edit mode: Add a max height and scrollable container
2024-10-02 13:28:19 +02:00
Pavel Laptev
3b280597fa layout update + remove "ActionView" component 2024-10-02 12:07:11 +02:00
Mattias Granlund
3008244201 Fix errors that appeared after svelte plugin upgrade 2024-10-02 11:26:15 +02:00