Commit graph

77 commits

Author SHA1 Message Date
Stefan Haller 61b59837bb Use our new hyperlink support in confirmations 2024-08-24 10:36:01 +02:00
Stefan Haller f98b57aa5e Change direct access to Common.UserConfig to a getter
This will allow us to turn the field into an atomic.Value for safe concurrent
access.
2024-08-18 10:24:52 +02:00
Stefan Haller df3afb1b89 Replace CurrentSideContext() with Context().CurrentSide() 2024-08-17 11:14:51 +02:00
Stefan Haller 7ed94c0410 Replace CurrentContext() with Context().Current() 2024-08-17 11:14:51 +02:00
Stefan Haller 82a3d33ce3 Remove calls to Error()
Now that we have an error handler set, we can simply let them bubble up all the
way to gocui.
2024-04-18 10:10:30 +02:00
Eng Zer Jun f933a2f7ec
Replace min/max helpers with built-in min/max
We upgraded our minimum Go version to 1.21 in commit
57ac9c2189. We can now replace our
`utils.Min` and `utils.Max` functions with the built-in `min` and `max`.

Reference: https://go.dev/ref/spec#Min_and_max
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2024-04-07 23:24:10 +08:00
Stefan Haller b9a75ee0ed Make links clickable in confirmation panels
This is not opt-in, we do it always. I can't imagine a situation where we
wouldn't want it.
2024-03-29 10:55:33 +01:00
Stefan Haller 3b29705a78 Add config to truncate commit hashes when copying them to the clipboard
I often copy hashes in the commits panel in order to paste them into Github
comments (or other places), and I can't stand it when they have the full length.

I picked a default of 12 for this; I find this to be a good middle ground
between being reliable in large repos (12 still works in the linux kernel repo
today, but it might not be enough in really huge repos) and not being too ugly
(many smaller repos can probably get away with less).

We deliberately don't change this for the "Copy to clipboard" menu, since this
gives users a way to copy the unabbreviated sha if they need this occasionally.
2024-03-22 09:58:54 +01:00
Jesse Duffield 51fb82d6bf Enforce single-item selection in various actions
We want to show an error when the user tries to invoke an action that expects only
a single item to be selected.

We're using the GetDisabledReason field to enforce this (as well as DisabledReason
on menu items).

I've created a ListControllerTrait to store some shared convenience functions for this.
2024-01-19 10:50:49 +11:00
Jesse Duffield 9cc1d65280 Add demo test variant
We're piggybacking on our existing integration test framework to record  demos that we can include in our docs
2023-07-31 22:33:04 +10:00
Jesse Duffield d772c9f1d4 Use sentence case everywhere
We have not been good at consistent casing so far. Now we use 'Sentence case' everywhere. EVERYWHERE.

Also Removing 'Lc' prefix from i18n field names: the 'Lc' stood for lowercase but now that everything
is in 'Sentence case' there's no need for the distinction.

I've got a couple lower case things I've kept: namely, things that show up in parentheses.
2023-05-25 23:52:19 +10:00
Jesse Duffield f8c9ce33c2 move more actions into controller 2023-04-30 13:19:53 +10:00
Jesse Duffield 1b2fb34ffd start moving getDisplayStrings funcs into contexts 2023-04-30 13:19:53 +10:00
Jesse Duffield 8edad826ca Begin refactoring gui
This begins a big refactor of moving more code out of the Gui struct into contexts, controllers, and helpers. We also move some code into structs in the
gui package purely for the sake of better encapsulation
2023-04-30 13:19:52 +10:00
Jesse Duffield 7410acd1aa move merge conflicts code into controller 2022-08-07 11:16:03 +10:00
Jesse Duffield 445a625b56 rename merging context to mergeConflicts 2022-08-06 18:05:00 +10:00
Jesse Duffield 524bf83a4a refactor to only have one context per view 2022-08-06 13:49:11 +10:00
Jesse Duffield e68093fe99 add scrollbars 2022-04-16 17:29:17 +10:00
Jesse Duffield ecaff7fc6c add commit files controller 2022-03-17 19:13:40 +11:00
Jesse Duffield 722410aded refactor controllers 2022-03-17 19:13:40 +11:00
Jesse Duffield cd31a762b9 rename OSCommand field to os 2022-03-17 19:13:40 +11:00
Jesse Duffield 482bdc4f1e more refactoring 2022-03-17 19:13:40 +11:00
Jesse Duffield f0c81ea6dc remove redundant popup checks 2022-03-17 19:13:40 +11:00
Jesse Duffield 1dd7307fde start moving commit panel handlers into controller
more

and more

move rebase commit refreshing into existing abstraction

and more

and more

WIP

and more

handling clicks

properly fix merge conflicts

update cheatsheet

lots more preparation to start moving things into controllers

WIP

better typing

expand on remotes controller

moving more code into controllers
2022-03-17 19:13:40 +11:00
Jesse Duffield a90b6efded start refactoring gui 2022-03-17 19:13:40 +11:00
Jesse Duffield c8cc18920f improve merge conflict flow 2022-01-26 14:50:47 +11:00
Jesse Duffield 364c5db19c shorten name 2022-01-09 14:09:53 +11:00
Jesse Duffield c9a0cc6b30 refactor 2022-01-09 14:09:53 +11:00
Jesse Duffield f503ff1ecb start breaking up git struct 2022-01-09 14:09:53 +11:00
Jesse Duffield 0d3e5e6a1d simplify fetch 2022-01-07 10:52:51 +11:00
Jesse Duffield 91fe68576c refactor 2022-01-07 10:52:51 +11:00
Jesse Duffield 05fa483f48 simplify how we log commands 2022-01-07 10:52:51 +11:00
Jesse Duffield 01ea5813a8 align Gui struct with GitCommand 2022-01-04 09:07:15 +11:00
Jesse Duffield 1996eddd91 more efficient context diff size changing 2021-12-06 22:37:28 +11:00
Jesse Duffield 37be9dbea1 support scrolling left and right 2021-11-05 07:58:21 +11:00
Jesse Duffield adee0b8ccb add spans to i18n 2021-04-11 23:36:34 +10:00
Jesse Duffield 84b0c3df4f ask question button 2021-04-11 22:07:29 +10:00
Jesse Duffield 069c7c9d35 fix test 2021-04-11 17:07:49 +10:00
Jesse Duffield 393ce05860 allow focusing on command log view 2021-04-11 17:07:49 +10:00
Jesse Duffield 4f03d7733a allow showing, hiding, and scrolling the extras panel 2021-04-11 17:07:49 +10:00
Jesse Duffield f2007f4d95 support scrolling extras view 2021-04-11 17:07:49 +10:00
Jesse Duffield 6fbe660f96 full coverage for logging commands 2021-04-11 17:07:49 +10:00
Jesse Duffield d627b3bfc8 more refactoring 2021-04-06 19:34:32 +10:00
Jesse Duffield b6cc1c9492 small refactor 2021-04-06 19:34:32 +10:00
Jesse Duffield 4fe512ff3a test
type safe view access
2021-04-06 19:34:32 +10:00
Jesse Duffield d44ff447bd fix panic 2021-04-06 19:34:32 +10:00
Jesse Duffield 798d3e2d54 get rid of these positively ghastly method signatures 2021-04-06 19:34:32 +10:00
Jesse Duffield e8f99c3326 better scroll support 2021-04-06 19:34:32 +10:00
Jesse Duffield 3ea5e4d4b2 allow scrolling when staging lines or building patch 2021-04-06 19:34:32 +10:00
Jesse Duffield 7d62f103e4 big refactor to give our enums actual types 2021-04-02 11:00:15 +11:00