* Handle node public key mismatch and show warning
- Add a mismatchKey flag to Node and MessageTopBar to indicate a public key mismatch.
- Set the public key to a default error value (all zeros) when a node's public key changes.
- Display a warning in the MessageTopBar when a key mismatch is detected in PKC.
- Only clear all nodes when a different mynode number is present.
* feat: Add key mismatch detection to NodeInfoDao
This commit introduces a new feature to the `NodeInfoDao` that detects and handles public key mismatches for existing nodes.
- A new function `upsertCheckKeyMatch` is added to `NodeInfoDao` that checks for public key changes when upserting a node. If a mismatch is detected, the public key is set to `ERROR_BYTE_STRING`, and a warning is logged.
- The function `upsertCheckKeyMatch` is used instead of `upsert` in `NodeRepository` and in `putAll` inside of `NodeInfoDao`.
- A new test `testPkcMismatch` is added to `NodeInfoDaoTest` to verify the key mismatch detection.
- Changed `testNodes` to have unique public keys.
- Added `mismatchKey` state to the node model.
* detekt spacing
* Refactor: Correctly handle different node installations in NodeRepository
The logic for detecting different node installations in `NodeRepository.kt` was inverted, this commit fixes the logic to use `!=` instead of `==` to detect if the node number has changed.
* fix#1484: Filter out ignored nodes from map
- Created a new `filteredNodeList` `StateFlow` in `UIState.kt` that filters out nodes marked as ignored.
- Updated `MapFragment.kt` to use `filteredNodeList` instead of `nodeList`, ensuring that ignored nodes are not displayed on the map.
* Refactor: Remove ExperimentalCoroutinesApi opt-in and add it to compiler args
- Removes the `@OptIn(ExperimentalCoroutinesApi::class)` annotation from multiple files.
- Adds `-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi` to the `freeCompilerArgs` in the `build.gradle` file, enabling the use of Experimental Coroutines API project-wide without the need for per-file opt-ins.
- The coroutine api is now applied globally.
Signed-off-by: James Rich <james.a.rich@gmail.com>
* detekt
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
---------
Signed-off-by: James Rich <james.a.rich@gmail.com>
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Modify the Paxcount display logic to show the string if either `ble` or `wifi` is not zero, rather than requiring both to be non-zero.
Signed-off-by: James Rich <james.a.rich@gmail.com>
* Add dependency to KotlinX immutable collections
* Build a Compose-stable UI state vs using a database model. Move appropriate mapping logic for converting database model -> UI state into the view model. Introduce animations to new log placement and automated scroll.
* Center the top card row vertically
* Move log message generation into separate method
---------
Co-authored-by: James Rich <2199651+jamesarich@users.noreply.github.com>
* Implement initial support for adding and removing nodes from favorites
* Make favorite nodes' names show up bold in the node list
* Forgot to add this here when I was fixing the previous merge conflicts. Whoops!
* Make detekt happy
---------
Co-authored-by: James Rich <2199651+jamesarich@users.noreply.github.com>
* Refactor: We can draw the horizontal lines for the graphs independent of min and max entries.
* Added navigation to the PowerMetrics log with a skeleton screen.
* Drew channel 1 voltage.
* Refactor: Assigned colors for the data within the enum instead of a list-ordinal combo.
* Plotted Ch1 current line.
* Refactor: Did not need the parameters being used to get the desired ui in the TimeLabels composable.
* Added a row to help distinguish between units.
* Refactor: MetricsTimeSelector.kt to SlidingSelector.kt; the new version allows for generic options.
* Added a sliding selector to choose between power channels and changed the legend data to instead display current and voltage.
* We now plot the line for which the user has selected a power channel option.
* Don't need the current line to be dotted anymore.
* Don't think we need to display an info dialog for voltage and current.
* Wrote card to display the power channel data entries.
* detekt
* Refactor: current color change to accommodate the themes better
---------
Co-authored-by: James Rich <2199651+jamesarich@users.noreply.github.com>
* Filter out emojis from text when finding initials
* Confirm non-English non-emoji unicde isn't filtered
* Remove unused example unit test
---------
Co-authored-by: James Rich <2199651+jamesarich@users.noreply.github.com>
* feat(config): implement excluded modules validation
* feat: hide excluded configs from metadata
* refactor: save local metadata from WantConfig
* refactor: delete metadata from deleted nodes
* fix: always request metadata for admin routes
* feat: show node firmware when metadata is available
* refactor: rename filter function
* feat: add `ServiceAction` request metadata
* feat: add support for Device Hardware json and svg graphics
Allows for better hardware device display names, graphics, and indication of support.
* make detekt happy
* Fix: Use first image name to find vector drawable
Use the first image name from the `images` list (after removing the ".svg" suffix) to find the corresponding vector drawable resource.
* Refactor: Update device detail layout
Updated the device detail layout to group device-specific information under a "Device" category.
Added a circular background with device-specific color behind the device icon.
Moved hardware, support status details to the Device section.
* Refactor: Move device hardware logic to MetricsViewModel
Moves the logic for retrieving device hardware information and image resources from NodeDetail to MetricsViewModel.
Also replaces id lookup with when statement for image resource id mapping.
* fix: cache deviceHardwareList, add exception handling
* refactor: mutable list unnecessary
* default to hw_unknown device image
* Add tapback emojis to message bubbles
Added TapBackEmojiItem composable to display tapback emojis.
Included it in MessageItem composable for incoming messages.
Added a FlowRow to show tapback emojis below the message bubble.
* feat: Add EmojiPicker View
* feat: show emojis for local messages
* feat: Add emoji tapbacks to messages
This commit introduces the ability to send and receive emoji tapbacks for messages.
- Adds emoji and replyId fields to DataPacket.
- Adds emoji tapback support to the MeshService
- Modifies UIState to handle emojis in message lists.
* feat: store tapbacks in database
Store tapbacks in the database and display them in the message list.
- Add a new table to the database to store tapbacks.
- Add a new DAO method to insert and retrieve tapbacks.
- Update the message list UI to display tapbacks.
* refactor: relation db and other changes
---------
Co-authored-by: Andre K <andrekir@pm.me>
* Started horizontal scrolling for DeviceMetrics. Drawing lines based on the TimeFrame and setting the dp.
* Wrote YAxisLabels(), it will replace the Y labels portion of the ChartOverlay(). The composable works for either side of the graph.
* Wrote HorizontalLinesOverlay(), it will replace the horizontal lines portion of the ChartOverlay().
* Updated the data points to use their actual x values.
* Based the width of the scrollable graph on time.
* Added a date label to the TimeAxisOverlay.