From 7d8c3120e8b69cfd375f2935c3a8560d0536dcfb Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 18 Mar 2026 07:19:47 +0000
Subject: [PATCH 1/3] Initial plan
From c7f146f31c9473c1a17aba499ed636ced0d1b8e3 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Wed, 18 Mar 2026 07:22:34 +0000
Subject: [PATCH 2/3] =?UTF-8?q?Make=20close=20button=20stroke=20width=20th?=
=?UTF-8?q?inner=20(1.5=20=E2=86=92=201.2)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: cyanzhong <6745066+cyanzhong@users.noreply.github.com>
---
src/panel.ts | 2 +-
src/tooltip.ts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/panel.ts b/src/panel.ts
index 06beab3..1e9a759 100644
--- a/src/panel.ts
+++ b/src/panel.ts
@@ -171,7 +171,7 @@ function renderPane(dom: HTMLElement, view: EditorView) {
const closeBtn = document.createElement('button');
closeBtn.className = 'harper-pane-close';
- closeBtn.innerHTML = '';
+ closeBtn.innerHTML = '';
closeBtn.title = 'Close';
closeBtn.ariaLabel = 'Close';
closeBtn.onclick = () => {
diff --git a/src/tooltip.ts b/src/tooltip.ts
index 000e134..67638d1 100644
--- a/src/tooltip.ts
+++ b/src/tooltip.ts
@@ -159,7 +159,7 @@ function createTooltip(view: EditorView, diagnostic: Diagnostic) {
// Close button at card level (top-right corner)
const close = document.createElement('button');
close.className = 'harper-close';
- close.innerHTML = '';
+ close.innerHTML = '';
close.title = 'Close';
close.ariaLabel = 'Close';
close.onmousedown = (e) => e.preventDefault();
From f59d04544882b7d3608014adde0e09ab45f87827 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 19 Mar 2026 11:43:07 +0000
Subject: [PATCH 3/3] Extract close SVG and system font into shared constants
Co-authored-by: cyanzhong <6745066+cyanzhong@users.noreply.github.com>
---
src/const.ts | 4 ++++
src/panel.ts | 5 +++--
src/tooltip.ts | 5 +++--
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/const.ts b/src/const.ts
index ce67a21..942dd1f 100644
--- a/src/const.ts
+++ b/src/const.ts
@@ -1 +1,5 @@
export const repoUrl = 'https://github.com/MarkEdit-app/MarkEdit-proofreading';
+
+export const closeSvg = '';
+
+export const systemFont = 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif';
diff --git a/src/panel.ts b/src/panel.ts
index 1e9a759..984ff55 100644
--- a/src/panel.ts
+++ b/src/panel.ts
@@ -5,6 +5,7 @@ import type { ViewUpdate } from '@codemirror/view';
import { diagnosticsField, setDiagnosticsEffect } from './decoration';
import type { Diagnostic } from './decoration';
import { setAccentColor, findDiagnostic, buildCardContent, injectCardCSS } from './card';
+import { closeSvg, systemFont } from './const';
import { injectStyleSheet } from './styling';
const paneWidth = 290;
@@ -171,7 +172,7 @@ function renderPane(dom: HTMLElement, view: EditorView) {
const closeBtn = document.createElement('button');
closeBtn.className = 'harper-pane-close';
- closeBtn.innerHTML = '';
+ closeBtn.innerHTML = closeSvg;
closeBtn.title = 'Close';
closeBtn.ariaLabel = 'Close';
closeBtn.onclick = () => {
@@ -334,7 +335,7 @@ export function paneCSS(): string {
right: 0;
bottom: 0;
width: ${paneWidth}px;
- font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;
+ font-family: ${systemFont};
border-left: 1px solid rgba(0, 0, 0, 0.12);
background: rgba(255, 255, 255, 0.6);
-webkit-backdrop-filter: blur(12px);
diff --git a/src/tooltip.ts b/src/tooltip.ts
index 67638d1..a69f2a6 100644
--- a/src/tooltip.ts
+++ b/src/tooltip.ts
@@ -4,6 +4,7 @@ import type { Tooltip, TooltipView } from '@codemirror/view';
import { diagnosticsField } from './decoration';
import type { Diagnostic } from './decoration';
import { setAccentColor, buildCardContent, ignoreDiagnostic, injectCardCSS } from './card';
+import { closeSvg, systemFont } from './const';
import { injectStyleSheet } from './styling';
export const setClickTooltip = StateEffect.define();
@@ -85,7 +86,7 @@ export const tooltipCSS = `
overflow: hidden;
max-width: 320px;
min-width: 220px;
- font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, sans-serif;
+ font-family: ${systemFont};
user-select: none;
-webkit-user-select: none;
-webkit-touch-callout: none;
@@ -159,7 +160,7 @@ function createTooltip(view: EditorView, diagnostic: Diagnostic) {
// Close button at card level (top-right corner)
const close = document.createElement('button');
close.className = 'harper-close';
- close.innerHTML = '';
+ close.innerHTML = closeSvg;
close.title = 'Close';
close.ariaLabel = 'Close';
close.onmousedown = (e) => e.preventDefault();