From dd74cf9654bcf9d4e87ccd6c11072c5f7ffc888f Mon Sep 17 00:00:00 2001 From: Logan Yang Date: Wed, 13 May 2026 23:52:20 -0700 Subject: [PATCH] fix(settings): restore version chip + reset button hidden by Obsidian h1 CSS (#2445) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(settings): restore version chip + reset button hidden by Obsidian h1 CSS The top-of-settings row (Copilot Settings title, version chip, "(up to date)" annotation, Reset Settings button) is rendered but invisible in current Obsidian releases. DOM inspection confirms the

wrapping the row has `display: none` applied with `height: 0`: h1Texts: ["Copilot Settingsv3.3.0 (up to date)Reset Settings"] h1Styles: [{ display: "none", height: 0, visibility: "visible" }] Cause: Obsidian's settings modal CSS hides plugin-rendered

elements because Obsidian reserves the top-level heading slot in a settings tab for itself. This convention was tightened in a recent Obsidian release, so the same code that worked at

's introduction (PR #1194) and update-notification addition (PR #1415) now silently renders zero-height. Fix: replace the

with a
that carries the same heading-style classes (tw-text-2xl tw-font-bold) plus the existing flex/layout classes. The accessibility role/level preserves the heading semantic for screen readers without triggering Obsidian's display:none on real

. The small-text version chip is now explicitly tw-font-normal so it doesn't inherit the wrapper's tw-font-bold. Verified by DOM diagnostic in live Obsidian:

was being hidden;
is not affected by the same CSS rule. Co-Authored-By: Claude Opus 4.7 (1M context) * fix(settings): shrink restored heading and add spacing below Per request: make the restored title row much smaller (tw-text-2xl tw-font-bold → tw-text-base tw-font-semibold) and add tw-mb-4 spacing below it so it sits comfortably above the tabs row. Co-Authored-By: Claude Opus 4.7 (1M context) --------- Co-authored-by: Claude Opus 4.7 (1M context) --- src/settings/v2/SettingsMainV2.tsx | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/settings/v2/SettingsMainV2.tsx b/src/settings/v2/SettingsMainV2.tsx index c1d3c1a9..e18303e0 100644 --- a/src/settings/v2/SettingsMainV2.tsx +++ b/src/settings/v2/SettingsMainV2.tsx @@ -98,12 +98,21 @@ const SettingsMainV2: React.FC = ({ plugin }) => { return (
-
-

+
+ {/* Reason: Obsidian's settings modal CSS hides plugin-rendered

+ elements (display: none) because Obsidian reserves the top-level + heading for itself. Use a div with heading-equivalent styling. */} +
Copilot Settings
- v{plugin.manifest.version} + + v{plugin.manifest.version} + {latestVersion && ( <> {hasUpdate ? ( @@ -111,12 +120,15 @@ const SettingsMainV2: React.FC = ({ plugin }) => { href="obsidian://show-plugin?id=copilot" target="_blank" rel="noopener noreferrer" - className="tw-text-xs tw-text-accent hover:tw-underline" + className="tw-text-xs tw-font-normal tw-text-accent hover:tw-underline" > (Update to v{latestVersion}) ) : ( - (up to date) + + {" "} + (up to date) + )} )} @@ -127,7 +139,7 @@ const SettingsMainV2: React.FC = ({ plugin }) => { Reset Settings
-

+

{/* Add the key prop to force re-render */}