Skip to content

Conversation

dee077
Copy link
Contributor

@dee077 dee077 commented Jul 18, 2025

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Closes #662.

Description of Changes

  • Improved the ui accoding to the figma design
  • Added filter based on device name, mac address, and monitoring health status.

Screenshot

image

Pending things:

Explored solution for coordinate conversion

  • Define a linear transform using image width/height and bounding box.
  • Convert pixel [x,y] to lat/lng so nodes render at the same visual positions with some mathematical formula that can work.

@dee077 dee077 self-assigned this Jul 18, 2025
@dee077 dee077 added enhancement New feature or request gsoc-idea labels Jul 18, 2025
@dee077 dee077 changed the base branch from master to gsoc25-map July 22, 2025 11:05
@dee077 dee077 force-pushed the feature/662-improve-ui-device-list-popup-above-geo-map branch from 9b399f4 to 1ca5856 Compare July 22, 2025 11:33
@dee077 dee077 marked this pull request as ready for review July 22, 2025 11:33
@dee077 dee077 force-pushed the feature/662-improve-ui-device-list-popup-above-geo-map branch from 49ee46c to 7ae5d2f Compare July 22, 2025 13:52
@dee077 dee077 force-pushed the feature/662-improve-ui-device-list-popup-above-geo-map branch from 7ae5d2f to 0ae92f7 Compare July 23, 2025 20:05
@pandafy pandafy requested a review from Copilot July 24, 2025 10:04
Copy link

@Copilot 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 improves the device popup UI in the device map according to a Figma design and adds filtering functionality based on device name, MAC address, and monitoring health status. It also introduces a new floorplan view feature.

  • Redesigned the device popup UI with improved styling and interactive elements
  • Added search and filter functionality for devices by name, MAC address, and health status
  • Implemented a new floorplan visualization feature with floor navigation

Reviewed Changes

Copilot reviewed 11 out of 14 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
device_map.html Added indoor coordinates URL configuration
floorplan.js New file implementing floorplan visualization and navigation logic
device-map.js Enhanced popup with search, filtering, and floorplan integration
netjsongraph.css Updated popup styling to full width
floorplan.css New CSS styles for floorplan modal and navigation
device-map.css Updated styling for improved popup UI and health status indicators
apps.py Added floorplan assets and indoor coordinates URL configuration
views.py Added new indoor coordinates API view with test pagination
urls.py Added new API endpoint for indoor coordinates
serializers.py Added monitoring indoor coordinates serializer
filters.py Added filtering logic for device search and status filtering

@dee077 dee077 force-pushed the feature/662-improve-ui-device-list-popup-above-geo-map branch 3 times, most recently from a485a1f to 8c6bb02 Compare July 26, 2025 12:33
Copy link
Member

@pandafy pandafy left a comment

Choose a reason for hiding this comment

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

Good work @dee077!

I reviewed device-map.js and selenium tests thoroughly. We need to add some more selenium tests.

Comment on lines 32 to 38
HEALTH_STATUS_LABELS = {
"ok": "Ok",
"problem": "Problem",
"critical": "Critical",
"unknown": "Unknown",
"deactivated": "Deactivated",
}
Copy link
Member

Choose a reason for hiding this comment

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

Why do we require this? We already have a setting for this which we discussed on our 1-on-1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This way we can check the custom label as well
let me know if it is not required

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to custom label names.

Copy link
Member

@pandafy pandafy left a comment

Choose a reason for hiding this comment

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

The zooming in issue after exiting the fullscreen still exists.

device-map-2025-07-28_22.13.14.mp4

@dee077 can we hide the controls of the geographic map when floorplan is shown.

@dee077 dee077 force-pushed the feature/662-improve-ui-device-list-popup-above-geo-map branch 4 times, most recently from ac7a1aa to e4b6954 Compare July 31, 2025 15:03
Copy link
Member

@pandafy pandafy left a comment

Choose a reason for hiding this comment

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

device-map-2025-08-11_21.29.10.mp4

@dee077 the fullscreen zoom-in and zoom-out works perfectly for the first 4 image which are square-ish

It is not handling the last image properly. I am using the below floorplan.

image

@dee077
Copy link
Contributor Author

dee077 commented Aug 11, 2025

Pending things:

Copy link
Member

@pandafy pandafy left a comment

Choose a reason for hiding this comment

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

@nemesifier @dee077 and I discussed the following changes to the UI today

  • Device popup heading margin should be set to 0
  • Heading and close button should be at the same level
  • Device table height is 180px (max height)
    • If there's only one device, than it shall adapt accordingly
    • If there are more than 3 devices, then show a scroll bar. Otherwise, just show the three devices.
  • Make the filters highlighted when they are selected.
    • The default opacity should be 0.8
    • After clicking, the filter the opacity should be 1 (.health-status.active {opacity: 1})
  • Reduce the opacity of the disabled navigation arrow to 0.3
    • Set {cursor: default} on the disabled navigation arrow
  • Set {cursor: default} to active floor button floor-btn.active.selected
  • Change the color of active arrow to #737985
  • Changes to the floorplan overlay
    • Remove padding on floorplan heading
    • Add margin-bottom: 10px to the heading
    • Update the position of the close button
        #floorplan-heading {
            margin-bottom: 10px; 
            // remove padding 
        }
        #floorplan-close-btn {
            top: 8px; 
            right: 8px;
        }
  • Add hover effect on the close icons (set color: black on hover)
  • Floorplan navigation widget - if there are more floors available, and the selected floor is in the middle, then clicking on the navigation button should add new floors to the navigation widget instead of moving the selected floor.
  • Increase the margin of the floorplan navigation arrow (@dee077 I missed to write down the value of the margin, I guess it was 8px)

@pandafy
Copy link
Member

pandafy commented Aug 14, 2025

In our debugging session today, we found that the fullscreen can only be toggled by user gesture (not by JS from an async function).

Problem: Fullscreen mode can only be triggered by user gesture

Possible solution for the fullscreen navigation:

  1. Don't show the floorplan navigation in the fullscreen mode

    (Quick fix until we find a way to solve it properly)

  2. Show the floorplan navigation in fullscreen, but clicking on the floor will exit the fullscreen
    and then the floor will be changed. The user will see the changed floor in non fullscreen window

    (Almost implemented, con: clunky experience for the user)

  3. (Uncertain) Redo the implementation, use only one NetJSONGraph instance to render the
    data. When the user clicks on a floor, the background will be changed and the data will be
    rendered again.

    (I think this may not worth the effort right now. We can come back to this later if required)

@nemesifier
Copy link
Member

I think we need to go with 2. Not allowing to navigate floors is not acceptable. In the meantime we need to investigate option 3.

Please @pandafy @dee077 think on whether we could add logic in netjsongraph.js to facilitate option 3 and if it's technically feasible we can create a follow up issue to work on it in the coming months.

@nemesifier nemesifier changed the title [feature] Implement indoor maps #662 [feature] Added indoor maps #662 Sep 10, 2025
name="api_wifi_session_detail",
),
path(
"api/v1/monitoring/location/<str:pk>/indoor-coordinates/",
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be added to the docs.

Copy link
Member

Choose a reason for hiding this comment

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

This is still pending. Let's not wait for this as it can be addressed very quickly and I am worried if we delay this we may forget.

},
error() {
console.error("Could not load more devices from", url);
alert("Could not load more devices.");
Copy link
Member

Choose a reason for hiding this comment

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

Flag as translatable.

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

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

CSS adjustments

I tried re-adjusting sizes and move things around (180edaf), but this requires changing also a few details in openwisp-utils hence I opened openwisp/openwisp-utils#509 and made this PR depend on that branch, the result looks as follows:

Screenshot from 2025-09-10 18-40-33

The pop up autopan is not always working

Try this:

popup-pan

This happens because at the moment of opening the pop up, the rows are not rendered yet.

@dee077 can we fix this? For example, can we render the rows before opening the pop up? Or any other solution that ensures the pop up is fully visible after clicked in every situation.

Opening a map popup does not give "loading" visual feedback

Try opening a map point with throttling enabled in the browser console: there's no visual feedback about the loading operation.

It seems this problem is pre-existing, so I propose to create a new follow-up issue for this to be worked on later, unless you have a quick solution for this.

Lots of strings not flagged as translatable

Please flag all user facing strings as translatable.

Docs missing

We need to update the docs, but it seems counter productive to work on this now while we still have adjustments to make, I see we have a dedicated issue for that (#660) so let's work on that once we are done with the main changes.

@pandafy
Copy link
Member

pandafy commented Sep 11, 2025

Opening a map popup does not give "loading" visual feedback

Try opening a map point with throttling enabled in the browser console: there's no visual feedback about the loading operation.

It seems this problem is pre-existing, so I propose to create a new follow-up issue for this to be worked on later, unless you have a quick solution for this.

Opened #704

@dee077
Copy link
Contributor Author

dee077 commented Sep 11, 2025

Updates:

  • Fixed auto-panning issue.
  • Fixed unintended width of floorplan map popup as we are setting min-height to global CSS .leaflet-popup-content.
  • Flagged strings for translation when necessary.
  • Fixed pypi version change
Screencast.from.2025-09-11.19-06-47.webm

wating for openwisp/openwisp-utils#509

@dee077 dee077 force-pushed the feature/662-improve-ui-device-list-popup-above-geo-map branch 2 times, most recently from e1c7c13 to 1ed30c3 Compare September 11, 2025 16:40
@dee077 dee077 force-pushed the feature/662-improve-ui-device-list-popup-above-geo-map branch from 1ed30c3 to acec94b Compare September 11, 2025 16:40


class SeleniumTestMixin(BaseSeleniumTestMixin):
browser = "chrome"
Copy link
Member

Choose a reason for hiding this comment

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

I accidentally added this in my previous commit

Comment on lines +92 to +93
# TODO: Remove before merging - install branch build of openwisp-utils for CI testing
pip install -U -I "openwisp-utils @ https://github.com/openwisp/openwisp-utils/tarball/gsoc25-map-adjustments"
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

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

I pushed a minor adjustment for narrow screens 6556f36.

There's only one comment pending, then we can merge.

name="api_wifi_session_detail",
),
path(
"api/v1/monitoring/location/<str:pk>/indoor-coordinates/",
Copy link
Member

Choose a reason for hiding this comment

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

This is still pending. Let's not wait for this as it can be addressed very quickly and I am worried if we delay this we may forget.

@nemesifier nemesifier merged commit 7c44bdc into gsoc25-map Sep 12, 2025
27 of 28 checks passed
@nemesifier nemesifier deleted the feature/662-improve-ui-device-list-popup-above-geo-map branch September 12, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request gsoc-idea

Development

Successfully merging this pull request may close these issues.

[feature] Update Ui of pop up shown to list deivces on geo map

3 participants