Skip to content

Commit 57132dd

Browse files
committed
diag(editor): add height-chain diagnostic overlay + enable devtools
Adds a fixed-position overlay (black bg, green text, top-right) showing: - .editor-scroll-container clientHeight - parent/grandparent/great-grandparent clientHeight - editor.getHTML() length This lets us see exactly where the height chain breaks on Windows without needing DevTools. Also enables tauri devtools feature for release builds (F12 or right-click > Inspect should now work).
1 parent 0ccc74d commit 57132dd

5 files changed

Lines changed: 21 additions & 5 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "markhere",
3-
"version": "1.1.5",
3+
"version": "1.1.6",
44
"description": "A modern WYSIWYG Markdown editor with cross-platform support",
55
"type": "module",
66
"scripts": {

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "markhere"
3-
version = "1.1.5"
3+
version = "1.1.6"
44
description = "A modern WYSIWYG Markdown editor"
55
authors = ["markhere-team"]
66
edition = "2021"
@@ -13,7 +13,7 @@ crate-type = ["staticlib", "cdylib", "rlib"]
1313
tauri-build = { version = "2", features = [] }
1414

1515
[dependencies]
16-
tauri = { version = "2", features = [] }
16+
tauri = { version = "2", features = ["devtools"] }
1717
tauri-plugin-shell = "2"
1818
tauri-plugin-dialog = "2"
1919
tauri-plugin-fs = "2"

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"productName": "Markhere",
3-
"version": "1.1.5",
3+
"version": "1.1.6",
44
"identifier": "com.markhere.app",
55
"build": {
66
"beforeDevCommand": "npm run dev",

src/components/Editor/MainEditor.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,22 @@ export function MainEditor() {
329329
onDrop={handleWrapperDrop}
330330
aria-label="Editor workspace"
331331
>
332+
<div style={{ position: 'fixed', top: 60, right: 16, background: '#000', color: '#0f0', padding: 12, fontSize: 11, fontFamily: 'monospace', zIndex: 99999, pointerEvents: 'none', borderRadius: 4, maxWidth: 360, lineHeight: 1.6, whiteSpace: 'pre-wrap' } as React.CSSProperties}>
333+
{(() => {
334+
const el = document.querySelector('.editor-scroll-container') as HTMLElement;
335+
const parent = el?.parentElement as HTMLElement;
336+
const grand = parent?.parentElement as HTMLElement;
337+
const great = grand?.parentElement as HTMLElement;
338+
const r = (e: HTMLElement | null) => e ? `${e.clientHeight}px` : 'null';
339+
return [
340+
`scroll: ${r(el)}`,
341+
`parent: ${r(parent)}`,
342+
`grand: ${r(grand)}`,
343+
`great: ${r(great)}`,
344+
`html len: ${editor?.getHTML()?.length ?? 0}`,
345+
].join('\n');
346+
})()}
347+
</div>
332348
{/* WYSIWYG editor — hidden in source mode via CSS (keeps editor mounted) */}
333349
<div className="editor-wysiwyg-container" aria-hidden={sourceMode} style={sourceMode ? { display: 'none' } : undefined}>
334350
{isDragging && (

0 commit comments

Comments
 (0)