Skip to content

Conversation

muzaffarmhd
Copy link
Contributor

PR Checklist

If you have any questions, you can refer to the Contributing Guide

What is the current behavior?

Currently, when searching through messages in MQTTX, there is no highlighting of matching text.

Issue Number

#1854

What is the new behavior?

The search functionality now highlights the active payload in message items.

Preview

image

Does this PR introduce a breaking change?

  • Yes
  • No

@ysfscream ysfscream requested review from Copilot, ysfscream and Red-Asuka and removed request for ysfscream and Copilot June 16, 2025 15:19
@ysfscream ysfscream self-assigned this Jun 16, 2025
@ysfscream ysfscream moved this to In Progress in MQTTX Jun 16, 2025
@ysfscream ysfscream added enhancement New feature or request feature This pr is a feature desktop MQTTX Desktop labels Jun 16, 2025
@ysfscream ysfscream added this to the v1.12.0 milestone Jun 16, 2025
@ysfscream ysfscream assigned muzaffarmhd and unassigned ysfscream Jun 16, 2025
@ysfscream ysfscream requested review from ysfscream and Copilot June 16, 2025 15:21
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 implements active highlighting for topics and payloads in the MQTTX desktop application search functionality.

  • Passes search parameters to message components.
  • Adds computed properties to generate highlighted versions of topics and payloads.
  • Introduces utility functions for text highlighting, including integration with Prism for JSON-highlighted code.

Reviewed Changes

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

Show a summary per file
File Description
src/views/connections/ConnectionsDetail.vue Passes searchParams to the message list and adds a getter for active search terms.
src/utils/highlightSearch.ts Introduces utility functions for HTML-based text highlighting.
src/components/MsgRightItem.vue Updates topic and payload rendering to use highlighted text.
src/components/MsgLeftItem.vue Adds computed properties and highlights for topics and payloads, including preview highlighting.
src/components/MessageList.vue Forwards searchParams to message components.
Comments suppressed due to low confidence (1)

src/components/MsgLeftItem.vue:169

  • The property name 'hightlight' appears to be misspelled. Consider renaming it to 'highlight' to improve clarity and maintain consistency throughout the component.
if (this.hightlight && this.searchParams.payload) {

@ysfscream
Copy link
Member

@muzaffarmhd Hi! Thank you for your contribution, and sorry for the late review. It looks like it’s working now, but I’m wondering—does it behave the same under other themes as well?

@Red-Asuka Red-Asuka merged commit 1ec71f4 into emqx:main Jun 20, 2025
4 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in MQTTX Jun 20, 2025
@muzaffarmhd
Copy link
Contributor Author

Hello @ysfscream, Thanks for the review, It's alright. Yes, It does work under other themes, but I'm just unsure how readable it is with that highlighting, but it looked fine to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop MQTTX Desktop enhancement New feature or request feature This pr is a feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants