Skip to content

Show filename in diff sticky header #98

Closed

Activity

  1. paulmolluzzo commented on Mar 23, 2016

    @paulmolluzzo
    Contributor

    👍

  2. DrewML commented on Mar 24, 2016

    @DrewML
    Contributor

    Started working on this here. Working, but needs some cleanup before I submit a PR.

    Todo:

    • Unbind scroll/resize listeners on partial page nav to non-PR page
    • Debounce scroll event to prevent hammering the DOM so much
    • Only update file name label in DOM when it's changed from previous val
    • Wipe out value in header when not sticky (top of page)
  3. paulmolluzzo commented on Mar 24, 2016

    @paulmolluzzo
    Contributor

    @DrewML This is rad! Make a PR like this and put [WIP] in the title for now.

    A couple comments:

    • 👍 on unbinding the events. I haven't seen any errors but there might be a gotcha lurking out there.
    • 👎 for bothering with debounce. I don't think we'll notice any performance issue with this. There's no animations or anything going on.
    • 👍 on only painting on change. Save the file name to a var, then where you test for length test that it's not equal to the existing var. That said, this isn't a deal breaker IMO.
    • 👍 on removing it when it's not sticky. A CSS method is .js-sticky-offset-scroll:not(.is-stuck) .diff-toolbar-filename {display:none;}

    Something else, it's possible that the last file will never actually make it into the sticky bar if the file sizes are too small. You can hit the bottom before scrolling past the second to last file (see below). You might want to have the logic be "if you can't see the file show the next one, but if you're at the very bottom show the last file name". I'm not sure about this, and there are other scenarios where you can see the entirety of two files, and in that situation I don't know what's best exactly.

    In this screenshot I've scrolled to the bottom of the page and see two "complete" files:
    scrolled_to_bottom

  4. DrewML commented on Mar 24, 2016

    @DrewML
    Contributor

    @paulmolluzzo Appreciate the feedback - [WIP] PR opened. Will continue the discussion over there :)

  5. hkdobrev commented on Mar 30, 2016

    @hkdobrev
    Contributor

    Implemented in #99. Thanks @DrewML!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions