Compare commits
2 Commits
fc942a2b88
...
13271f11b6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13271f11b6 | ||
|
|
c2958ebf8c |
@@ -56,3 +56,17 @@
|
||||
新窗口仍能收到草稿提示;
|
||||
- 未命名保存直接落根目录、避让命名;
|
||||
- 「打开所在位置」资源管理器定位效果。
|
||||
|
||||
## 真机回修(2026-11-14 晚)
|
||||
|
||||
1. **未命名保存后文件树不刷新**:saveTab 只在新建/新建文件夹流程里刷
|
||||
树,保存落点变化(未命名首次保存、另存为)时没刷。已补:writeTextFile
|
||||
成功且路径变化时 setTreeRefresh +1。
|
||||
2. **侧栏拖拽显示禁止符号、drop 不触发**:实现本身(HTML5 DnD)在
|
||||
DOM 层测试是通过的,真机失效的根因是 Tauri 窗口默认开启
|
||||
`dragDropEnabled` 原生拖放拦截——它会吞掉 WebView 内的 HTML5 拖拽
|
||||
事件(本应用没有任何功能在用原生拖放事件)。主窗口配置
|
||||
(tauri.conf.json)与运行时新窗口(WebviewWindow 参数)均已设
|
||||
`dragDropEnabled: false`。附带好处:编辑器内 ProseMirror 的文本拖放
|
||||
同样被拦截所禁,一并恢复。若真机仍不行,下一步改指针式拖拽
|
||||
(pointer events 自绘),不再依赖 HTML5 DnD。
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"$schema":"https://schema.tauri.app/config/2","app":{"security":{"csp":null},"windows":[{"center":true,"decorations":false,"height":820,"label":"main","minHeight":600,"minWidth":920,"resizable":true,"title":"new-markdown","width":1280}]},"build":{"beforeBuildCommand":"npm run build","beforeDevCommand":"npm run dev","devUrl":"http://localhost:1420","frontendDist":"../dist"},"bundle":{"active":true,"category":"Productivity","icon":["icons/32x32.png","icons/128x128.png","icons/128x128@2x.png","icons/icon.ico","icons/icon.png"],"shortDescription":"Windows Markdown 所见即所得编辑器","targets":["nsis","msi"]},"identifier":"app.newmarkdown.desktop","productName":"new-markdown","version":"0.1.0"}
|
||||
{"$schema":"https://schema.tauri.app/config/2","app":{"security":{"csp":null},"windows":[{"center":true,"decorations":false,"height":820,"label":"main","minHeight":600,"minWidth":920,"resizable":true,"title":"new-markdown","width":1280,"dragDropEnabled":false}]},"build":{"beforeBuildCommand":"npm run build","beforeDevCommand":"npm run dev","devUrl":"http://localhost:1420","frontendDist":"../dist"},"bundle":{"active":true,"category":"Productivity","icon":["icons/32x32.png","icons/128x128.png","icons/128x128@2x.png","icons/icon.ico","icons/icon.png"],"shortDescription":"Windows Markdown 所见即所得编辑器","targets":["nsis","msi"]},"identifier":"app.newmarkdown.desktop","productName":"new-markdown","version":"0.1.0"}
|
||||
@@ -346,6 +346,7 @@ export default function App() {
|
||||
minWidth: 920,
|
||||
minHeight: 600,
|
||||
decorations: false,
|
||||
dragDropEnabled: false,
|
||||
})
|
||||
} catch (e) { setError(`打开新窗口失败:${String(e)}`) }
|
||||
}, [])
|
||||
@@ -389,6 +390,8 @@ export default function App() {
|
||||
}
|
||||
await writeTextFile(path, toDiskContent(snapshot, target.lineEnding), target.hadBom)
|
||||
dispatch({ type: 'saved', id: target.id, savedContent: snapshot, path, title: baseName(path) })
|
||||
// 落点变化(未命名首次保存、另存为)意味着磁盘上多/改了一个文件,刷新左侧文件树
|
||||
if (target.path !== path) setTreeRefresh((n) => n + 1)
|
||||
const stat = await statFile(path)
|
||||
if (stat.exists) baselinesRef.current.set(target.id, { mtimeMs: stat.mtimeMs, size: stat.size })
|
||||
// 恢复记录可能按旧键(未命名/旧路径)写入,新旧键都清,避免下次启动误报草稿
|
||||
|
||||
@@ -2,7 +2,9 @@ import type { ReactNode } from 'react'
|
||||
|
||||
/**
|
||||
* 自绘悬浮提示:跟随当前主题(界面变量),不用浏览器原生 title 气泡。
|
||||
* 纯 CSS 悬停/聚焦显示,带一点延迟避免划过时闪烁;气泡本身不拦截鼠标。
|
||||
* 纯 CSS 显示:鼠标悬停或键盘聚焦(:focus-visible)时延迟浮现;
|
||||
* 不能用 :focus-within——鼠标点过按钮后焦点留下,气泡会赖着不走。
|
||||
* 气泡本身不拦截鼠标。
|
||||
* 子元素应自带 aria-label,气泡只作视觉呈现(aria-hidden)。
|
||||
*/
|
||||
export default function Tooltip({ label, children }: { label: string; children: ReactNode }) {
|
||||
|
||||
@@ -350,7 +350,7 @@ kbd { background: var(--code-bg); border: 1px solid var(--border); border-radius
|
||||
/* 自绘悬浮提示(Tooltip 组件):跟随主题变量,悬停/聚焦延迟浮现 */
|
||||
.tooltip-wrap { position: relative; display: inline-flex; align-items: stretch; }
|
||||
.tooltip-wrap .tooltip-bubble { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%) translateY(2px); background: var(--bg-editor); color: var(--text); border: 1px solid var(--border); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18); font-size: 12px; font-weight: 400; line-height: 1.4; padding: 4px 8px; border-radius: 6px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.15s ease, transform 0.15s ease; z-index: 80; }
|
||||
.tooltip-wrap:hover .tooltip-bubble, .tooltip-wrap:focus-within .tooltip-bubble { opacity: 1; transform: translateX(-50%) translateY(0); transition-delay: 0.35s; }
|
||||
.tooltip-wrap:hover .tooltip-bubble, .tooltip-wrap:has(:focus-visible) .tooltip-bubble { opacity: 1; transform: translateX(-50%) translateY(0); transition-delay: 0.35s; }
|
||||
/* 自绘下拉(Dropdown 组件):按钮对齐 .input,展开层沿用应用菜单语言 */
|
||||
.dropdown { position: relative; }
|
||||
.dropdown-button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 6px; padding: 5px 9px; font-size: 13px; font-family: inherit; cursor: pointer; text-align: left; }
|
||||
|
||||
Reference in New Issue
Block a user