From 659c3c6a965010d6c644f7f33563308f613d6f86 Mon Sep 17 00:00:00 2001
From: Hao19911125 <99091644+Hao19911125@users.noreply.github.com>
Date: Sun, 5 Apr 2026 13:29:08 +0800
Subject: [PATCH] Add mobile config entry for message trace
---
panel.js | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/panel.js b/panel.js
index 5ea8f37..8f9eef8 100644
--- a/panel.js
+++ b/panel.js
@@ -794,6 +794,32 @@ function _switchConfigSection(sectionId) {
_syncConfigSectionState();
}
+function _ensureMobileTraceConfigNavButton() {
+ if (!panelEl) return;
+
+ const mobileNav = panelEl.querySelector(".bme-config-nav-mobile");
+ if (!mobileNav) return;
+ if (mobileNav.querySelector('[data-config-section="trace"]')) return;
+
+ const appearanceButton = mobileNav.querySelector(
+ '[data-config-section="appearance"]',
+ );
+ const traceButton = document.createElement("button");
+ traceButton.className = "bme-config-nav-btn";
+ traceButton.dataset.configSection = "trace";
+ traceButton.type = "button";
+ traceButton.innerHTML = `
+
+ 消息追踪
+ `;
+
+ if (appearanceButton?.parentNode === mobileNav) {
+ mobileNav.insertBefore(traceButton, appearanceButton);
+ } else {
+ mobileNav.appendChild(traceButton);
+ }
+}
+
function _syncConfigSectionState() {
if (!panelEl) return;
panelEl.querySelectorAll(".bme-config-nav-btn").forEach((btn) => {
@@ -1858,6 +1884,8 @@ function _refreshConfigTab() {
function _bindConfigControls() {
if (!panelEl || panelEl.dataset.bmeConfigBound === "true") return;
+ _ensureMobileTraceConfigNavButton();
+
panelEl.querySelectorAll(".bme-config-nav-btn").forEach((btn) => {
if (btn.dataset.bmeBound === "true") return;
btn.addEventListener("click", () => {