Skip to content

Fix bug with config not being highlighted on navbar#1096

Merged
1Blademaster merged 2 commits into
mainfrom
1065-bug-config-page-not-highlighted-in-navbar
Mar 17, 2026
Merged

Fix bug with config not being highlighted on navbar#1096
1Blademaster merged 2 commits into
mainfrom
1065-bug-config-page-not-highlighted-in-navbar

Conversation

@1Blademaster
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings March 17, 2026 21:10
@1Blademaster 1Blademaster linked an issue Mar 17, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates how the GCS tracks and emits “state” changes, especially around the /config route, so the UI can still update its current page without always emitting a set_state socket event.

Changes:

  • Middleware: always updates Redux currentPage on emitSetState, but suppresses the set_state socket emit when the state is exactly "config".
  • Layout: always dispatches emitSetState(currentPageLowerCase) (removes the prior "config" special-casing).
  • Navbar: adds a console.log(currentPage) debug statement.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
gcs/src/redux/middleware/emitters.js Prevents socket set_state emission for the "config" state while still updating Redux currentPage.
gcs/src/components/layout.jsx Always dispatches emitSetState on page changes (including "config").
gcs/src/components/navbar.jsx Adds a debug log of currentPage.
Comments suppressed due to low confidence (1)

gcs/src/components/layout.jsx:44

  • The useEffect uses aircraftTypeString and shouldFetchAllMissionsOnDashboard, but they are not included in the dependency array. This can lead to stale behavior (e.g., missing a loiter radius fetch when aircraftTypeString changes while on the dashboard, or not fetching missions after shouldFetchAllMissionsOnDashboard flips). Add the missing dependencies (and dispatch if you follow exhaustive-deps) or split this effect so each piece has the correct deps.
    dispatch(emitSetState(currentPageLowerCase))

    if (!connectedToDrone) return

    if (currentPageLowerCase == "dashboard") {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@1Blademaster 1Blademaster merged commit 5dd3350 into main Mar 17, 2026
5 checks passed
@1Blademaster 1Blademaster deleted the 1065-bug-config-page-not-highlighted-in-navbar branch March 17, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Config page not highlighted in navbar

2 participants