Skip to content

Commit 1e774e3

Browse files
committed
feat(v0.9.20): Auto-clear selection state on Focus Mode entry
- Modified handleDoubleClick() to automatically clear existing highlights before entering focus mode - Added highlightManager.unhighlight({ force: true }) call for clean state transition - Automatically hide statistics popup when entering focus mode to prevent visual conflicts - Enhanced user experience with pristine focused context without residual artifacts - Updated Interface Document.md, README.md, and TODO.md with v0.9.20 documentation - Added bilingual comments (EN/中文) explaining the auto-clear logic
1 parent a82eeaf commit 1e774e3

4 files changed

Lines changed: 51 additions & 4 deletions

File tree

Interface Document.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 2025-12-24 v0.9.19
1+
# 2025-12-24 v0.9.20
22

33
# Interface Document
44

@@ -249,6 +249,13 @@ Renders the JSON data into an interactive DAG.
249249
* **Behavior**: Double-clicking a related node while already in focus mode now properly refreshes the view to show the new node's context.
250250
* **Fix**: Removes restriction that prevented switching focus between related nodes, enabling seamless exploration of connected concepts.
251251
* **State Reset**: All node visibility flags are reset before entering new focus mode to prevent accumulation issues.
252+
253+
* **Selection State Auto-Clear (v0.9.20)**:
254+
* **Behavior**: When double-clicking a node to enter Focus Mode, any existing selection/highlight state is automatically cleared before entering the focused view.
255+
* **Implementation**:
256+
* Calls `highlightManager.unhighlight({ force: true })` to clear highlight state.
257+
* Hides the statistics popup if visible (`#node-stats-popup`).
258+
* **User Experience**: Provides a clean transition into Focus Mode without residual visual artifacts from previous selections, ensuring the focused view is always clear and uncluttered.
252259

253260
* **Scalability Defaults (v0.8.8)**:
254261
* **Orphans**: Hidden by default.
@@ -484,7 +491,6 @@ Manages node highlighting interactions for both PC and mobile interfaces.
484491
* **Focus Mode**: Highlighting disabled, focus mode handles visualization.
485492

486493

487-
```
488494

489495

490496

@@ -833,4 +839,3 @@ Manages node highlighting interactions for both PC and mobile interfaces.
833839
2. **资源编译**: `npm run build` -> 填充 `dist/frontend`
834840
3. **同步**: `npx cap sync android` ->`dist/frontend` 复制到 `android/app/src/main/assets/public`
835841
4. **原生构建**: `gradlew assembleDebug` -> 编译 APK
836-

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ NoteConnection uses **Capacitor** to build native mobile apps.
119119

120120
## 📅 Changelog
121121

122+
### v0.9.20 - Selection State Auto-Clear on Focus Entry (2025-12-24)
123+
- [x] **Clean Focus Transition**: When double-clicking a node to enter Focus Mode, any existing selection or highlight state is now automatically cleared, providing a clean and uncluttered focused view.
124+
- [x] **Auto-Hide Popup**: The statistics popup is automatically hidden when entering Focus Mode, preventing visual conflicts.
125+
- [x] **Enhanced UX**: Ensures users always start with a pristine focused context without residual artifacts from previous node selections.
126+
122127
### v0.9.19 - Focus Mode & Popup Enhancements (2025-12-24)
123128
- [x] **Focus Mode Re-entry**: Fixed issue where double-clicking a related node while in focus mode wouldn't refresh properly. Now seamlessly switches focus between connected nodes.
124129
- [x] **Draggable Popup**: Node statistics popup can now be dragged by its header to any screen position for better workspace organization.

TODO.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,33 @@
1-
# 2025-12-24 v0.9.19
1+
# 2025-12-24 v0.9.20
22

33
# Project Build Plan: Progressive Hierarchical Knowledge Graph
44

55
This document outlines the roadmap for building `NoteConnection`, a system capable of visualizing tens of thousands of knowledge points as a Directed Acyclic Graph (DAG), highlighting hierarchical relationships and learning paths.
66

77
---
88

9+
# 2025-12-24 v0.9.20 - Selection State Auto-Clear on Focus Entry
10+
11+
**Goal**: Automatically clear any existing selection or highlight state when entering Focus Mode via double-click for a clean transition.
12+
13+
- [x] **Auto-Clear Implementation**
14+
- [x] **Highlight Clearing**: Modified `handleDoubleClick()` to call `highlightManager.unhighlight({ force: true })` before entering focus mode.
15+
- [x] **Popup Hiding**: Automatically hide the statistics popup (`#node-stats-popup`) when entering focus mode.
16+
- [x] **State Management**: Ensures clean state transition without residual visual artifacts.
17+
18+
- [x] **User Experience Enhancement**
19+
- [x] **Clean Transition**: Users always start with a pristine focused context.
20+
- [x] **Visual Clarity**: Prevents confusion from overlapping highlights between normal and focus modes.
21+
- [x] **Consistent Behavior**: Standardized focus mode entry behavior across all scenarios.
22+
23+
- [x] **Documentation**
24+
- [x] **Interface Document**: Updated with v0.9.20 selection auto-clear specifications.
25+
- [x] **README**: Added v0.9.20 changelog entries in both English and Chinese.
26+
- [x] **Code Comments**: Bilingual comments explaining the auto-clear logic.
27+
- [x] **TODO**: Documented completed feature implementation.
28+
29+
---
30+
931
# 2025-12-24 v0.9.19 - Focus Mode & Popup Enhancements
1032

1133
**Goal**: Fix focus mode refresh issues and add drag/zoom functionality to the statistics popup for better user experience.

src/frontend/app.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,12 +785,27 @@ function handleDoubleClick(event, d) {
785785
// 要求:双击进入专注模式
786786
// v0.9.19 Fix: Allow re-entering focus mode for different nodes
787787
// v0.9.19 修复:允许为不同节点重新进入专注模式
788+
// v0.9.20 Enhancement: Auto-clear selection state when entering focus mode
789+
// v0.9.20 增强:进入专注模式时自动清除选择状态
788790

789791
if (focusNode && focusNode.id === d.id) {
790792
// Already focused on same node -> Open Reader
791793
// 已经专注于同一节点 -> 打开阅读器
792794
if (window.reader) window.reader.open(d);
793795
} else {
796+
// Clear any existing selection/highlight state before entering focus mode
797+
// 在进入专注模式前清除任何现有的选择/高亮状态
798+
if (window.highlightManager) {
799+
window.highlightManager.unhighlight({ force: true });
800+
}
801+
802+
// Hide statistics popup if visible
803+
// 如果统计弹窗可见则隐藏
804+
const popup = document.getElementById('node-stats-popup');
805+
if (popup && popup.style.display !== 'none') {
806+
popup.style.display = 'none';
807+
}
808+
794809
// Enter or Re-enter Focus Mode for new node
795810
// 为新节点进入或重新进入专注模式
796811
// This properly handles the case when double-clicking a related node while in focus mode

0 commit comments

Comments
 (0)