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

issues: sticky hdr covers selected line fixes #598 #690

Closed
wants to merge 3 commits into from
Closed

issues: sticky hdr covers selected line fixes #598 #690

wants to merge 3 commits into from

Conversation

the-j0k3r
Copy link
Member

@the-j0k3r the-j0k3r commented Jul 15, 2018

This uncovers just enough of the selected line to be a good candidate to fix #598

Im using this now locally and it works reliably enough to warrant this PR.

Re: non-default sticky header styles/scripts,

If there is a problem with those, it is beyond the scope of this issue and this fix, IMO and they need to be addressed separately and should not be a blocker for anything like this.

@maxrothman since you were the person to report the issue maybe this would be a good enough solution rather than none or having to do js workaround scripts.

oauth-octicon-x

@silverwind
Copy link
Member

Hmm, can you uncover maybe 2 pixels more through reducing the padding on the stickied header? Note that I'm generally against stickying this header, but I see the issue is rather complicated.

@the-j0k3r
Copy link
Member Author

the-j0k3r commented Jul 19, 2018

Not really, try it yourself it will get hairy really quick after this and it wont look nice when its not stuck.

@the-j0k3r
Copy link
Member Author

the-j0k3r commented Jul 19, 2018

I was just giving this more thought, perhaps theres a better solution, but it will probably double the amount of code, Im wondering if you can make it look one way when not stuck and another when stuck by using these @support rules.

I'll play around for the sake of interest in learning a new trick.

@silverwind
Copy link
Member

Let's not add too many hacks, I'll see what can be done about compat with refined-github and if a user wants these sticky headers, they should install that extension. The issue with the out-of-view linked lines is also present with it, by the way.

@the-j0k3r
Copy link
Member Author

the-j0k3r commented Jul 19, 2018

I dont think what I was thinking is going to work.

try this

  @supports (position: sticky) or (position: -webkit-sticky) {
    .pull-request-tab-content .diff-view .file-header {
      position: sticky !important;
      position: -webkit-sticky !important;
      top: 35px !important;
      z-index: 6 !important;
    }
    .pull-request-tab-content .file-header {
      height: 39px !important;
    }
    .pull-request-tab-content .diff-view .file-actions,
    .pull-request-tab-content .diff-view .file-info {
      margin-top: -1px !important;
    }
  }

if you're happy with that Ill push it instead.

edit...

capture
thats a magnified screenie.

@silverwind
Copy link
Member

See #701 for my idea of not stickying at all in the style.

@the-j0k3r
Copy link
Member Author

As I commented there, the code in my comment above yours is the best compromise between stuck/unstuck I could find, and Im used to the idea and find that sort of useful.

A third solution is to make my amended proposal entirely optional. as long as it works with #701 in same way. I know its a big can of worms.

@the-j0k3r
Copy link
Member Author

Let me know if you want the code as is or if you want the revised on the comment above. Im around for another 10 minutes before I go take a break ;)

@silverwind
Copy link
Member

This is how this PR looks on my screen:

screenshot 2018-07-19 at 21 08 23

With top: 34px it would line up perfectly with the line for me. If I then make .pull-request-tab-content .file-header also 34px high, it looks almost alright, except the button is slightly off-center vertically. What do you think?

@the-j0k3r
Copy link
Member Author

34px is too much, if you consider eagle eyes at stuck/unstuck mode

with

  @supports (position: sticky) or (position: -webkit-sticky) {
    .pull-request-tab-content .diff-view .file-header {
      position: sticky !important;
      position: -webkit-sticky !important;
      top: 35px !important;
      z-index: 6 !important;
    }
    .pull-request-tab-content .file-header {
      height: 39px !important;
    }
    .pull-request-tab-content .diff-view .file-actions,
    .pull-request-tab-content .diff-view .file-info {
      margin-top: -1px !important;
    }
  }

looks like

capture

@the-j0k3r
Copy link
Member Author

Ive pushed the tweak.

@silverwind
Copy link
Member

top: 35px and height: 36px looks fine on my screen (height: 39px leaves a slightly off-center button).

@the-j0k3r
Copy link
Member Author

thats the problem, your 36 height kills the centering on unstuck,

Ive played with this for a long time now to find a good balance between stuck/unstuck and centering on both.

@silverwind
Copy link
Member

silverwind commented Jul 19, 2018

Try this:

.pull-request-tab-content .diff-view .file-header {
  top: 40px !important;
}
.pull-request-tab-content .file-header {
  height: 32px !important;
  padding: 1px 10px;
}

@the-j0k3r
Copy link
Member Author

Nope, 40px leaves the 1px gap and around we go to reason why I opened #612 :/

@the-j0k3r
Copy link
Member Author

well idk... Ill push that

@silverwind
Copy link
Member

Well then make it 39px, still looks alright for me, but I don't see that gap you mentioned.

@the-j0k3r
Copy link
Member Author

the-j0k3r commented Jul 19, 2018

pushed...

RGH eat our shorts :)

@silverwind
Copy link
Member

Merged in 9b5fa7e with followup tweak in 5743cd7.

@silverwind silverwind closed this Jul 19, 2018
@the-j0k3r
Copy link
Member Author

Again you broke it with your tweak

capture

@the-j0k3r
Copy link
Member Author

@silverwind you closed it, is that cause my commit count is getting to high? JK lol

@silverwind
Copy link
Member

No, it's just GitHub being too dumb to detect CLI merges :)

@the-j0k3r
Copy link
Member Author

the-j0k3r commented Jul 19, 2018

EH it also strips everyone's lovely signature on PR merge via rebase/squash :(

CLI merge you need to pull my branch before, which is convoluted also. I never got that process when the PR already implies that its been pushed.

@silverwind
Copy link
Member

I don't mess with branches usually, I just use apply-pr.

@the-j0k3r
Copy link
Member Author

the-j0k3r commented Jul 19, 2018

Ah not buggy then :) 3yr old tool :)

Youde be better served with Git aliases

@the-j0k3r the-j0k3r deleted the selected-line--fix-#598 branch January 6, 2020 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Floating header in PR files view covers selected line
2 participants