-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add button to change width of diff view #22824
Conversation
It looks good! However, since you changed a database table, you need to add a migration to |
routers/web/repo/middlewares.go
Outdated
} | ||
|
||
ctx.Data["IsWidthFull"] = width == "full" | ||
if err := user_model.UpdateUserDiffViewWidth(ctx.Doer, width); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a temporary change, so we shouldn't change the user's preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this should be permanent. Just like split/unified view. Personally I want it always to be full.
Since we have |
This problem seems to be somewhat more complex than it looks. Some backgrounds:
In my opinion:
|
Just having it full width without any setting would be my preference too, but I imagine it's quite a difference for the user so I thought I'll offer an option. I don't really know how to continue on in this PR is there a consensus on just removing the compact view? Or should I enhance my setting approach so it's mergeable. |
Usually most liked solution wins. And there is a Technical Oversight Committee could help to make final decisions if I understand correctly. |
This is an alternative solution to #22824 and would also close #22781 This makes the PR diff view always full width. It makes sense to make use of that screen real estate. If you want a more narrow view you can always resize your browser. It also avoids cluttering the UI with another button + the database with another column for the setting. This is also how github and gitlab do it.
As #22844 has been merged. I will close this PR. |
Fixes #22781
This adds a button that let's you configure the width of the diff viewer. I think this feature shouldn't be tied to the unified/split view button so now it's entirely separate.
I used the lock/unlock Icon because it was available. If anyone has a better Icon I'm welcome to change it. I'm unsure where you are sourcing your icons from though or who is designing them, they look quite nice.