Skip to content

Conversation

@IDisposable
Copy link
Contributor

@IDisposable IDisposable commented Oct 21, 2025

Closes #617

Summary

Folks with more than one JetKVM want to be able to distinguish them at a glace. The current device display Home screen has enough space to display a name, and with recent networking changes, displaying the user-defined (or defaulted) hostname will help.

UI Changes

  • None on web UI

Checklist

  • Linked to issue(s) above by issue number (e.g. Closes #<issue-number>)
  • One problem per PR (no unrelated changes)
  • Lints pass; CI green
  • [ ] Tricky parts are commented in code N/A
  • [ ] Backward compatible with existing device firmware (See DEVELOPMENT.md for details) N/A

Copy link
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

This PR adds the ability to display the active hostname on the device's home screen, helping users distinguish between multiple JetKVM devices at a glance.

Key Changes:

  • Added a new label widget to display the hostname on the home screen
  • Integrated hostname retrieval from the network manager
  • Added a new font style (LabelFontBook24) to support varied text sizing

Reviewed Changes

Copilot reviewed 13 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
internal/native/eez/src/ui/styles.c Made layout adjustments to flex styles
internal/native/eez/src/ui/screens.h Added home_info_hostname object declaration
internal/native/eez/src/ui/screens.c Created hostname label widget and adjusted spacing/layout across multiple screens
internal/native/eez/jetkvm.eez-project-ui-state Removed UI state file (project-specific configuration)
display.go Added call to update hostname label from network manager

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@adamshiervani adamshiervani left a comment

Choose a reason for hiding this comment

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

The screen is too crowded with IPv4, IPv6, MAC and hostname. Let's just replace the MAC address with the hostname if we have an IPv4 IP. Once the user has an IP, the MAC address isn't that useful to have on the device. If they really need it, they can copy it from the network settings.

@IDisposable
Copy link
Contributor Author

IDisposable commented Oct 27, 2025

The screen is too crowded with IPv4, IPv6, MAC and hostname. Let's just replace the MAC address with the hostname if we have an IPv4 IP. Once the user has an IP, the MAC address isn't that useful to have on the device. If they really need it, they can copy it from the network settings.

Done, also was able to restore the 30pt font on the IPv4

@IDisposable IDisposable force-pushed the feat/hostname branch 2 times, most recently from c082bb4 to ca63198 Compare October 30, 2025 08:07
@IDisposable
Copy link
Contributor Author

Did a bunch of work on the JetKVM display (EEZ Studio stuff)

  • Added MAC to the Status Screen (so when it disappears from the Home Screen there's still some place to see it).
  • Made LVGL variables for IPv4 Address, IPv6 Address, Hostname, and MAC Address, so multiple device screens can show that information and it will update in all places as they are changed.
  • Sets the Device Id label on the Status Screen.
  • Forces an immediate uiTick every time a label value or visibility is changed.
  • Massive cleanup of the flags in the EEZ file to make all the screens scroll correctly and ripple up gestures.
  • Added the StatusScreenGesture action and SwitchToNetwork action for use in back-arrows.
  • Fixed a couple identifiers to make the code more reviewable.
  • Hostname will scroll circularly (like IPv6 does now) if too wide.
  • Added clicked event on the "Network" button on the to switch to the Network Screen.
  • Eliminated the FontBold24 style and font because we can show the IPv4 in the original 30 point size.
  • Set the "back" button for the children of the Advanced Menu to go back to that menu instead of the main screen.
  • Fixed the wonkiness with the advanced menu child screens where they saw the menu button as the immediate press of the action (reboot/reset/change DHCP)

The way things are working correctly we want the following things in objects in EEZ Studio:

  • All Screens should have no behavioral Flags and not be clickable.
  • All children of every screen should have (probably only) Gesture Bubble so the swipe gestures are active.
  • All button literals or images should only Gesture Bubble and Event Bubble so the screens are swipe-able and the touching the text/graphic is treated as a Click on the parent Button.
  • All button images (like the left-pointing arrow) should have Advance Hit Test to ensure clicking it activates the parent button.
  • All buttons should be clickable, and events should be tied to the Click event (not the Press event). The only exception to this is the press-for-N-seconds buttons on the Reset, Reset Configuration, and Switch DHCP Client buttons, which use all the press events.
  • When a region needs scrolling, there are two containers. The outer one adds a 4px right padding, and is clickable, but not set up for scrolling. It must only have the Gesture Bubble flag and should be set for 85% height. The inner container should be clickable, have Gesture Bubble, Scrollable, Scroll Momentum, Scroll Elastic, and *not have Scroll Chain Horizontal nor Scroll Chain Vertical. It should have Scrollbar Mode: auto, Scroll Direction: VER, and not Scroll Snap *. The inner container should have a height of 163px to ensure the scroll region renders correctly.
  • The children elements of the scrollable regions (Container/Button/Literals) must have Scroll Chain Horizontal, Scroll Chain Vertical, and Gesture Bubble. The button literal texts also need Event Bubble.
  • Literal fields that are not "action" triggers are given only Gesture Bubble and are not Clickable
  • When a variable is changed, we call the screen tick for each screen it's on. This is done by calling them in the set_var_* methods in vars.c e.g. tick_screen_home_screen(); or tick_screen_status_screen();. All of the tick_screen_* methods are declared in vars.h
  • Styles got cleaned up to eliminate the "redundant settings" warnings.

@adamshiervani
Copy link
Contributor

adamshiervani commented Oct 30, 2025

on the Settings, Advanced, and Status pages, the scrolling seems to have stopped working.

That's very odd, as this is what I've been fighting with all along to get consistent behavior. Can you verify that your jetkvm.eez-project file matches what is currently checked in? (I did a bunch of force-pushes right at the end to get this over the line). Could you try running EEZ Studio and clicking the Build and seeing if it tries to change any of the "output" files in internal/native/eez/src/ui directory?

Just checking back here:

  • The main Menu page also has the Network and Access buttons commented out (as it was when I started), so nothing to scroll.
  • The Advanced page only has the Reboot/DHCP Client and Reset Configuration enable (Developer Mode and USB Emulation were already hidden when I started), so there's nothing to scroll.
  • The Status page has the Account ID hidden (as it was when I started), so it doesn't actually have enough (non-hidden) entries to need scrolling.
  • The Network screen (which is not reachable right now) has only three things so it doesn't need to scroll (but will if we add more)
  • The About page does, and scrolls correctly on my device.

Please note any pages above that you want me to enable what's hidden and then we'll have a lot more scrolling ;)

Also, for visual consistency, could you make the hostname font size match the MAC address?

  • Sure, just was trying to make it a bit bigger, but easy change :)

And while you’re at it, could we add a “--” placeholder when there’s no IPv4? I think this might have been lost during the cgo migration.

  • Sure thing, though that will make the logic for the show/hide of the MAC Address a tiny bit wonky

@IDisposable
Copy link
Contributor Author

(oops, I accidentally edited your comment instead of replying, sorry @adamshiervani)

nativeInstance.UpdateLabelAndChangeVisibility("golang_version", version.GoVersion)

// nativeInstance.UpdateLabelAndChangeVisibility("boot_screen_device_id", GetDeviceID())
nativeInstance.UpdateLabelAndChangeVisibility("device_id", GetDeviceID())
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use UISetVar here too and remove UpdateLabelAndChangeVisibility completely?
EEZ has the ability to change visibility based on a variable, but I'm not sure whether we want to complicate the EEZ code or the Golang code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think absolutely that would be much simpler! I just didn't know if you folks would mind that big a change. I'll do it (my) Friday night.

Copy link
Contributor

@ym ym Nov 7, 2025

Choose a reason for hiding this comment

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

We can do it in a separate PR instead. Let's keep this one PR from getting too big :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure thing.

Any thoughts about Adam's comments? Do we need to reenable and of those other screens?

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.

Custom name on display

3 participants