Option: navbar sticks on top of the window#1121
Merged
Merged
Conversation
kennethrioja
force-pushed
the
ui-navbar-reduction
branch
from
July 3, 2025 12:07
b027c4c to
0a98e8a
Compare
fbacall
requested changes
Jul 7, 2025
Comment on lines
+376
to
+383
|
|
||
| <% if TeSS::Config.feature['sticky_navbar'] %> | ||
| /** | ||
| * Created by Kenneth Rioja on 02.07.2025 | ||
| * | ||
| * Sticky Navbar | ||
| */ | ||
|
|
Member
There was a problem hiding this comment.
I would not toggle the feature this way, since it would involve rebuilding the JS/CSS if the feature is toggled.
Instead you can add a class or data attribute to the header (or body element even) in the ERB templates if the feature is enabled, and then check for that class/attribute dynamically with a JS selector.
Comment on lines
+1019
to
+1024
|
|
||
| <% if TeSS::Config.feature['sticky_navbar'] %> | ||
| .navbar { | ||
| border-radius: 0; | ||
| font-size: larger; | ||
| padding-top: 20px; |
Member
There was a problem hiding this comment.
See other comment.
If you add an additional class to the header when the sticky navbar feature is enabled, you can just add the CSS rules to that class and they will be ignored if the feature is not enabled.
fbacall
approved these changes
Jul 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #1120
Summary of changes
tess.example.yml: you have nowsticky_navbaroption underfeature, set tofalseby default, whentrueit allows the header to stick to the top of the window and shrink (animated) a bit while scrolling downapplication.jsandapplication.scss: added the.erbextension to both files to allow<% if TeSS::Config.feature['sticky_navbar'] %>_header.hrml.erb: incorporatedheader_noticeto theheader class="unified-header">to allow sticking to the top at anytimeMotivation and context
Not being able to click on the navbar when in the bottom of the window, it is frustrating and 'effortful' to scroll to the top everytime
Checklist
to license it to the TeSS codebase under the
BSD license.