Skip to content

Fix: Make header sticky on desktop.#848

Open
oscarmuya wants to merge 1 commit into
ActivityWatch:masterfrom
oscarmuya:dev/sticky-desktop-header
Open

Fix: Make header sticky on desktop.#848
oscarmuya wants to merge 1 commit into
ActivityWatch:masterfrom
oscarmuya:dev/sticky-desktop-header

Conversation

@oscarmuya
Copy link
Copy Markdown

Make the header sticky on desktop.
The header was already sticky on mobile. This extends that behavior to desktop as well.

Fixes #299

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 28, 2026

Greptile Summary

This PR extends the sticky header behavior from Android-only to all platforms by hardcoding fixedTopMenu to true in Header.vue. The existing BootstrapVue fixed="top" prop and the .fixed-top-padding spacer class already handle the layout shift for the fixed navbar correctly.

  • fixedTopMenu was previously set to this.$isAndroid, limiting sticky behavior to Android; it is now unconditionally true.
  • No new CSS or template changes were needed — the existing sticky-header plumbing (fixed navbar prop + 3.5em padding spacer) works equally well on desktop.

Confidence Score: 5/5

Safe to merge — the change is a single-line toggle that enables already-tested sticky-header infrastructure on desktop.

The existing BootstrapVue fixed=top prop and the .fixed-top-padding spacer were already working correctly on Android, so extending them unconditionally to all platforms is low-risk. The only finding is a now-stale inline comment.

No files require special attention.

Important Files Changed

Filename Overview
src/components/Header.vue Single-line change hardcodes fixedTopMenu to true, making the navbar always sticky instead of only on Android. The existing .fixed-top-padding spacer and BootstrapVue fixed="top" prop handle the layout shift correctly.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Header component mounted] --> B{fixedTopMenu?}
    B -- "Before: this.$isAndroid" --> C{Running on Android?}
    C -- Yes --> D[fixed='top' navbar + fixed-top-padding class]
    C -- No --> E[Standard in-flow navbar, no padding spacer]
    B -- "After: true always" --> D
    D --> F[Sticky header at top of viewport, 3.5em spacer div below]
    E --> G[Header scrolls with page]
Loading

Reviews (1): Last reviewed commit: "Fix: Make header sticky on desktop." | Re-trigger Greptile

Comment thread src/components/Header.vue
Comment on lines 139 to +140
// Make configurable?
fixedTopMenu: this.$isAndroid,
fixedTopMenu: true,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 The comment // Make configurable? is now stale — the value is unconditionally true and no longer derived from any condition, so the question of configurability is less relevant. Consider removing or updating the comment to reflect the intent.

Suggested change
// Make configurable?
fixedTopMenu: this.$isAndroid,
fixedTopMenu: true,
fixedTopMenu: true,

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 34.38%. Comparing base (5c04d24) to head (fcd56cc).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #848   +/-   ##
=======================================
  Coverage   34.38%   34.38%           
=======================================
  Files          36       36           
  Lines        2114     2114           
  Branches      403      386   -17     
=======================================
  Hits          727      727           
- Misses       1308     1366   +58     
+ Partials       79       21   -58     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Sticky navbar

1 participant