Skip to content
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

Various code view improvements #30014

Merged
merged 25 commits into from
Mar 24, 2024
Merged

Various code view improvements #30014

merged 25 commits into from
Mar 24, 2024

Conversation

silverwind
Copy link
Member

@silverwind silverwind commented Mar 23, 2024

  1. Restore missing styles for message close icon
  2. Move code-line-button so that it does not go off-screen on small viewports
  3. Make code-line-button look and behave like other buttons
  4. Make code-line-button work in blame
  5. Make the active selection span the whole line, not just the code part
  6. Tweak colors, make dark theme code bg darker, make line numbers same color in diff and file view.
  7. Move code background to parent, fixing border radius and other problems
  8. Enable code wrap in blame
  9. Improve blame responsiveness
  10. Remove --color-code-sidebar-bg in blame, now it uses same background as code
  11. Rename --color-active-line to --color-highlight-bg
  12. Add --color-highlight-bg
  13. Fix button group borders on hover and border-right on last button.
Screenshot 2024-03-23 at 22 34 13 Screenshot 2024-03-23 at 22 34 26 Screenshot 2024-03-23 at 22 34 57 Screenshot 2024-03-23 at 22 34 42

Fixes: #18074

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 23, 2024
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 23, 2024
@silverwind silverwind added the type/enhancement An improvement of existing functionality label Mar 23, 2024
@silverwind silverwind force-pushed the codetweaks branch 2 times, most recently from 4300ebc to 61fb904 Compare March 23, 2024 00:39
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 23, 2024
@yardenshoham
Copy link
Member

Did... Did you just add jQuery code to the codebase?

@yardenshoham
Copy link
Member

What have I done to deserve this

@delvh
Copy link
Member

delvh commented Mar 23, 2024

I think the problem is that this file is already using jQuery heavily, so using something else would only be more confusing at the moment.

@yardenshoham
Copy link
Member

Fine :(

@silverwind
Copy link
Member Author

silverwind commented Mar 23, 2024

Can rewrite without I guess. The whole function was very hard to read because of those confusing variable names it has.

@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 23, 2024
@silverwind
Copy link
Member Author

I guess this is as much refactor as I'm willing to do right now. Variable names are much clearer now and some jQuery is removed.

@silverwind silverwind marked this pull request as draft March 23, 2024 14:37
@github-actions github-actions bot added the modifies/templates This PR modifies the template files label Mar 23, 2024
@silverwind
Copy link
Member Author

More tweaks done. Code sidebar is gone on blame. Two new CSS variables for the highlight added. Blame button muted, background moved to parent, fixing border radius issue.

Screenshot 2024-03-23 at 15 48 00 Screenshot 2024-03-23 at 15 48 14 Screenshot 2024-03-23 at 15 48 46 Screenshot 2024-03-23 at 15 48 28

@silverwind silverwind marked this pull request as ready for review March 23, 2024 14:51
@silverwind
Copy link
Member Author

Unescape button was missing right border in blame view, fixed in b867329 so that 2nd and 2nd to last button is considered for border addition:

image

@silverwind
Copy link
Member Author

Blame commit links now look like this:

Screenshot 2024-03-23 at 16 09 39

I also added underline styles to base, I think they were lost as a regression from #29980.

@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Mar 23, 2024
@silverwind
Copy link
Member Author

Regression with a:hover from #29980 confirmed. I cleaned up the styles and also added a devtest example for links:

image

@github-actions github-actions bot removed the modifies/go Pull requests that update Go code label Mar 23, 2024
@silverwind
Copy link
Member Author

Screenshots updated in OP. Ready to go imho.

@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Mar 23, 2024
@techknowlogick techknowlogick added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Mar 24, 2024
Co-authored-by: 6543 <6543@obermui.de>
@silverwind
Copy link
Member Author

I will try to get code-line-button not to hide line number is between 1 and 3 digits, e.g. like GitHub:

image

Copy link
Member

@6543 6543 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets merge this and itterate on it

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 24, 2024
@6543 6543 enabled auto-merge (squash) March 24, 2024 11:45
@6543 6543 added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 24, 2024
@6543 6543 merged commit db01bf6 into go-gitea:main Mar 24, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.23.0 milestone Mar 24, 2024
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 24, 2024
@silverwind silverwind deleted the codetweaks branch March 24, 2024 15:44
silverwind added a commit that referenced this pull request Mar 25, 2024
Fix regression from #30014. The
rule was to broad and affecting things like `primary` button
unintentionally.
@lunny lunny modified the milestones: 1.23.0, 1.22.0 Mar 26, 2024
DennisRasey pushed a commit to DennisRasey/forgejo that referenced this pull request Mar 30, 2024
Fix regression from go-gitea/gitea#30014. The
rule was to broad and affecting things like `primary` button
unintentionally.

(cherry picked from commit bbaf62589fe538be4afc86455d772360de80e7d8)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jun 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code modifies/js modifies/templates This PR modifies the template files size/L Denotes a PR that changes 100-499 lines, ignoring generated files. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to scroll to see all content in Blame window
7 participants