Skip to content

Commit 47e6bcf

Browse files
committed
fix(noteblock): reconcile Vim editor read/write paths with yNoteDocument (#111)
1 parent ccf9c9a commit 47e6bcf

7 files changed

Lines changed: 1052 additions & 22 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1313

1414
### Fixed
1515

16+
- Fixed Vim editor showing empty content on collaborative NoteBlocks after page refresh. Edits made in Vim mode now persist correctly and remain visible across reloads [#111](https://github.com/3xpyth0n/ideon/issues/111).
1617
- Fixed file upload error handling crash when the server response is not valid JSON (e.g. proxy timeout, network interruption). The client now gracefully handles non-JSON error responses instead of throwing a `SyntaxError` [#110](https://github.com/3xpyth0n/ideon/issues/110).
1718

1819
## [0.9.2] - 2026-06-19

src/app/components/VersionBadge.tsx

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ export function VersionBadge({ currentVersion }: VersionBadgeProps) {
158158
>([]);
159159
const [changelogLoading, setChangelogLoading] = useState(false);
160160
const [changelogError, setChangelogError] = useState(false);
161+
const showDelayRef = useRef<ReturnType<typeof setTimeout> | null>(null);
161162

162163
useEffect(() => {
163164
fetch("/api/system/version")
@@ -182,42 +183,45 @@ export function VersionBadge({ currentVersion }: VersionBadgeProps) {
182183
}
183184
}, []);
184185

186+
const cancelShow = useCallback(() => {
187+
if (showDelayRef.current) {
188+
clearTimeout(showDelayRef.current);
189+
showDelayRef.current = null;
190+
}
191+
}, []);
192+
185193
const scheduleHide = useCallback(() => {
186194
cancelHide();
195+
cancelShow();
187196
hideTimeoutRef.current = setTimeout(() => {
188197
if (!isHoveringBadgeRef.current && !isHoveringTooltipRef.current) {
189198
setShowTooltip(false);
190199
}
191200
}, 150);
192-
}, [cancelHide]);
193-
194-
useEffect(() => {
195-
if (
196-
isMounted &&
197-
(isHoveringBadgeRef.current || isHoveringTooltipRef.current)
198-
) {
199-
const timer = setTimeout(() => setShowTooltip(true), 50);
200-
return () => clearTimeout(timer);
201-
}
202-
}, [isMounted]);
201+
}, [cancelHide, cancelShow]);
203202

204203
const handleBadgeMouseEnter = (e: React.MouseEvent) => {
205204
isHoveringBadgeRef.current = true;
206205
cancelHide();
206+
cancelShow();
207207
const rect = e.currentTarget.getBoundingClientRect();
208208
setTooltipPos({
209209
top: rect.bottom + 6,
210210
left: rect.left + rect.width / 2,
211211
});
212212
if (!isMounted) {
213213
setIsMounted(true);
214-
} else {
215-
setShowTooltip(true);
216214
}
215+
showDelayRef.current = setTimeout(() => {
216+
if (isHoveringBadgeRef.current || isHoveringTooltipRef.current) {
217+
setShowTooltip(true);
218+
}
219+
}, 50);
217220
};
218221

219222
const handleBadgeMouseLeave = () => {
220223
isHoveringBadgeRef.current = false;
224+
cancelShow();
221225
if (hasUpdate) {
222226
scheduleHide();
223227
} else {

src/app/components/dashboard/ProjectList.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,19 @@ export function ProjectList({ view, folderId }: ProjectListProps) {
328328
if (e.key === "Escape" && selectedItems.size > 0) {
329329
setSelectedItems(new Set());
330330
}
331+
if ((e.ctrlKey || e.metaKey) && e.key === "a") {
332+
const tag = (document.activeElement as HTMLElement)?.tagName;
333+
if (tag === "INPUT" || tag === "TEXTAREA") return;
334+
e.preventDefault();
335+
const allKeys = new Set<string>();
336+
folders.forEach((f) => allKeys.add(`folder:${f.id}`));
337+
projects.forEach((p) => allKeys.add(`project:${p.id}`));
338+
setSelectedItems(allKeys);
339+
}
331340
};
332341
window.addEventListener("keydown", onKeyDown);
333342
return () => window.removeEventListener("keydown", onKeyDown);
334-
}, [selectedItems]);
343+
}, [selectedItems, folders, projects]);
335344

336345
const dispatchFavoriteChanged = useCallback(
337346
(

0 commit comments

Comments
 (0)