Skip to content

chore: update .gitignore and remove tracked generated files#3

Merged
hrygo merged 30 commits into
mainfrom
chore/gitignore-cleanup
Jan 30, 2026
Merged

chore: update .gitignore and remove tracked generated files#3
hrygo merged 30 commits into
mainfrom
chore/gitignore-cleanup

Conversation

@hrygo

@hrygo hrygo commented Jan 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Update .gitignore with comprehensive ignore rules for Go projects
  • Remove previously tracked generated files from git index

Changes

Category Files Description
Go Testing coverage.out, coverage.html, *.test, *.prof Coverage reports & profiling
Debug __debug_bin* Delve debugger binaries
Air .air.toml, tmp/ Live reload config & cache
Qoder .qoder/ Qoder wiki cache (100+ files)

Impact

  • Cleaner git history
  • Reduced repository size
  • No functional changes

Test User and others added 30 commits January 30, 2026 21:35
- Add three-state mode cycling (Normal → Geek → Evolution)
- Add ModeCycleButton and ModeThemeProvider components
- Add Evolution Mode CSS theme (Purple/Blue DNA style)
- Add comprehensive unit tests for EvolutionParrot
- Update i18n translations for mode labels

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update evolution mode input placeholder to "🧬 进化永无止境,您有什么想法?"
- English: "🧬 Evolution never ends, what's on your mind?"
- Traditional Chinese: "🧬 進化永無止境,您有什麼想法?"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Normal mode: "今天有什么我可以帮您发现的?" / "What can I help you discover today?"
- Geek mode: "🤖 终端就绪。请输入指令…" / "🤖 Terminal ready. Enter your command..."
- Evolution mode: "🧬 进化永无止境,您有什么想法?"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Normal: 💡 今天又有什么灵感?有什么需要我为您安排?
- Geek: 🤖 终端已就绪,等待您的指令…
- Evolution: 🧬 进化永无止境,您有什么想法?

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Evolution Mode: bio elements, vine borders, cell division, organic particles
- Geek Mode: Matrix digital rain effect, character burst, grid overlay
- Both modes include accessibility support (prefers-reduced-motion)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add matrix background to Geek Mode
- Add bio background to Evolution Mode
- Add grid overlay to Geek Mode chat area
- Add flow background to Evolution Mode chat area

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Simplify matrix rain from 3 layers to 1 layer
- Simplify evolution bio background from 3 layers to 1 layer
- Remove unused ::after pseudo-elements
- Add will-change hints for GPU acceleration
- Reduce animation frequency
- Remove filter-based animations (poor performance)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create DivineEye and DivineEyeCompact components
- Mode-aware animations: normal (soft breathing), geek (digital pulse), evolution (organic pulse)
- Replace mobile header breathing dot with Divine Eye
- Replace desktop header avatar with Divine Eye
- Add themed CSS animations with performance optimization

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- RouteHeaderImage now accepts mode prop
- Apply different animations based on mode:
  - Normal: soft breathing with purple glow
  - Geek: glitch effect with green hue shift
  - Evolution: organic pulse with rotation and color shift
- Restore original ChatHeader avatar

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Eye shape: breathing animation with scale and opacity
- Pupil: pulsing animation with radius change
- Neural rays: sequential pulse with staggered delays

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Normal mode: gentle breathing animation
- Geek mode: glitch effect with step timing
- Evolution mode: organic pulse with rotation
- Uses CSS selectors based on body mode classes
- Added prefers-reduced-motion support

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Increase scale range (1.05 → 1.12 normal, 1.2 evolution)
- Add scale changes to geek glitch mode
- Increase rotation angle (2deg → 5deg evolution)
- Speed up animations for more visibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add breathing animation to eye container
- Add pulsing animation to center pupil (radius 15→20)
- Add glow animation to outer pupils
- Add sequential scan animation to ray lines
- Apply to both header-ai.svg and header-ai-zh.svg

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace r (radius) animation with transform: scale()
- Add will-change hint for GPU acceleration
- Performance: CPU bound → GPU accelerated
Change Record<string, string> to Record<"sm" | "md" | "lg" | "xl", string>
to ensure sizeClasses matches the actual size prop type, preventing
invalid key access at compile time.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add interactive avatar component with:
- Mouse hover effects (scale, shadow, 3D tilt animation)
- Typing state animations (pulse, wave ripples)
- Thinking state animations (breathing with glow)
- Mode-specific styles (Geek green, Evolution purple)
- Performance optimizations (memo, static classes, GPU acceleration)

Also updates ChatMessages, ChatHeader, PartnerGreeting to use the new
AnimatedAvatar component instead of static avatar images.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove console.log debug statements from ModeCycleButton and AIChat
- Update Geek/Evolution mode chat placeholders to be more descriptive
- Add i18n keys for mode-specific greetings and prompts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove console.log from Connect RPC interceptors
- Simplify timeout interceptor (remove redundant logging)
- Remove unused useAIQueries debug code
- Fix MasonryColumn layout (remove unnecessary max-width)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove redundant paths and simplify SVG structure for smaller bundle size.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- PartnerGreeting now displays mode-specific greetings and prompts
- Geek Mode: "终端已连接" with code-focused suggestions
- Evolution Mode: "进化模式已激活" with improvement-focused prompts
- ChatHeader: migrate hardcoded status text to i18n
- Optimize: remove unnecessary useMemo for timeConfig
- Fix: hide "Claude Code" implementation detail from UI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove unused lastItemsLengthRef
- Remove unused startTime variable

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove unused variables (lastItemsLengthRef, startTime, isPinned)
- Remove unused imports (useState in StreamingMarkdown)
- Fix CapabilityType enum usage (use value import, not type-only)
- Fix unused parameters (prefix with _ for intentionally unused)
- Remove unused onDismiss from inner components

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The format string %04x produces only 4 hex digits, resulting in
invalid 28-character UUID. Changed to %012x to produce
valid 36-character UUID format.

Fixes panic: "uuid: Parse(...): invalid UUID length: 28"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix import order (react imports before local)
- Apply code formatting (indentation, line breaks)
- Resolves CI static-checks failures

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix parrotId type in StreamingMarkdown (string → ParrotAgentType)
- Add biome-ignore comment for protobuf workaround in useAIQueries
- Apply Biome auto-format to all affected files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Lint 工作流 section with frontend/backend commands
- Document pre-commit hook behavior
- Add Biome format issues to debugging lessons

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Evolution Parrot as 5th agent in agent table
- Add comparison table for Geek Mode vs Evolution Mode
- Clarify positioning: Geek Mode helps users, Evolution Mode evolves the system
- Update AI agent architecture diagram with Evolution Mode priority routing
- Add EvolutionMode to ARCHITECTURE.md agent types and routing docs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Based on EVOLUTION_MODE_SPEC.md:

- Add work directory and output columns to agent table
- Add detailed comparison table (定位/目标用户/工作目录/产出/安全等级/视觉风格)
- Update spec reference to point to EVOLUTION_MODE_SPEC.md
- Remove redundant comparison section, replace with routing priority
- Update ARCHITECTURE.md with work directory, output, and security level details

Key distinctions:
- Geek Mode: 通用任务助手 → 用户沙箱 → 用户下载产物
- Evolution Mode: 系统自我进化引擎 → 源代码根目录 → GitHub PR

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…lable

- Add skipIfNoCLI() helper function
- Skip tests requiring CLI if 'claude' command not found in PATH
- This allows CI to pass without installing Claude Code CLI

Tests that now skip when CLI unavailable:
- TestNewEvolutionParrot
- TestEvolutionParrotPermissionDenied
- TestEvolutionParrotSetDeviceContext
- TestEvolutionParrotSelfDescribe
- TestEvolutionParrotResetSession
- TestEvolutionParrotCancel
- TestEvolutionParrotAdminOnlyEnvVar
- TestEvolutionParrotCallbackError

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Go test/coverage files: coverage.out, coverage.html, *.test, *.prof
- Add debug binaries: __debug_bin*
- Add Air live reload: .air.toml, tmp/
- Add Qoder cache: .qoder/
- Remove previously tracked coverage.out and .qoder/ from git index
@hrygo hrygo merged commit 69be302 into main Jan 30, 2026
8 checks passed
@hrygo hrygo deleted the chore/gitignore-cleanup branch January 31, 2026 10:23
hrygo added a commit that referenced this pull request Feb 5, 2026
* feat(evolution): add evolution mode UI and unit tests

- Add three-state mode cycling (Normal → Geek → Evolution)
- Add ModeCycleButton and ModeThemeProvider components
- Add Evolution Mode CSS theme (Purple/Blue DNA style)
- Add comprehensive unit tests for EvolutionParrot
- Update i18n translations for mode labels

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(i18n): update evolution mode placeholder text

- Update evolution mode input placeholder to "🧬 进化永无止境,您有什么想法?"
- English: "🧬 Evolution never ends, what's on your mind?"
- Traditional Chinese: "🧬 進化永無止境,您有什麼想法?"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(i18n): add themed placeholders for all modes

- Normal mode: "今天有什么我可以帮您发现的?" / "What can I help you discover today?"
- Geek mode: "🤖 终端就绪。请输入指令…" / "🤖 Terminal ready. Enter your command..."
- Evolution mode: "🧬 进化永无止境,您有什么想法?"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(i18n): improve placeholder text with better tone

- Normal: 💡 今天又有什么灵感?有什么需要我为您安排?
- Geek: 🤖 终端已就绪,等待您的指令…
- Evolution: 🧬 进化永无止境,您有什么想法?

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* style(visual): add themed visual effects for Evolution and Geek modes

- Evolution Mode: bio elements, vine borders, cell division, organic particles
- Geek Mode: Matrix digital rain effect, character burst, grid overlay
- Both modes include accessibility support (prefers-reduced-motion)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(ui): apply visual effects to chat layout for Geek/Evolution modes

- Add matrix background to Geek Mode
- Add bio background to Evolution Mode
- Add grid overlay to Geek Mode chat area
- Add flow background to Evolution Mode chat area

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* perf(visual): optimize mode theme performance

- Simplify matrix rain from 3 layers to 1 layer
- Simplify evolution bio background from 3 layers to 1 layer
- Remove unused ::after pseudo-elements
- Add will-change hints for GPU acceleration
- Reduce animation frequency
- Remove filter-based animations (poor performance)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(ui): add Divine Eye animated logo replacing status dot

- Create DivineEye and DivineEyeCompact components
- Mode-aware animations: normal (soft breathing), geek (digital pulse), evolution (organic pulse)
- Replace mobile header breathing dot with Divine Eye
- Replace desktop header avatar with Divine Eye
- Add themed CSS animations with performance optimization

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(ui): add mode-aware animations to RouteHeaderImage logo

- RouteHeaderImage now accepts mode prop
- Apply different animations based on mode:
  - Normal: soft breathing with purple glow
  - Geek: glitch effect with green hue shift
  - Evolution: organic pulse with rotation and color shift
- Restore original ChatHeader avatar

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(logo): add divine eye animations to logo.svg

- Eye shape: breathing animation with scale and opacity
- Pupil: pulsing animation with radius change
- Neural rays: sequential pulse with staggered delays

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(ui): add mode-aware animations to NavigationDrawer logo (logo.webp)

- Normal mode: gentle breathing animation
- Geek mode: glitch effect with step timing
- Evolution mode: organic pulse with rotation
- Uses CSS selectors based on body mode classes
- Added prefers-reduced-motion support

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(ui): enhance logo animation visibility

- Increase scale range (1.05 → 1.12 normal, 1.2 evolution)
- Add scale changes to geek glitch mode
- Increase rotation angle (2deg → 5deg evolution)
- Speed up animations for more visibility

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(ui): add animations to header SVG eye icon

- Add breathing animation to eye container
- Add pulsing animation to center pupil (radius 15→20)
- Add glow animation to outer pupils
- Add sequential scan animation to ray lines
- Apply to both header-ai.svg and header-ai-zh.svg

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* perf(svg): optimize header SVG animation performance

- Replace r (radius) animation with transform: scale()
- Add will-change hint for GPU acceleration
- Performance: CPU bound → GPU accelerated

* fix(web): improve type safety in AnimatedAvatar sizeClasses

Change Record<string, string> to Record<"sm" | "md" | "lg" | "xl", string>
to ensure sizeClasses matches the actual size prop type, preventing
invalid key access at compile time.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(web): add AnimatedAvatar with hover and typing animations

Add interactive avatar component with:
- Mouse hover effects (scale, shadow, 3D tilt animation)
- Typing state animations (pulse, wave ripples)
- Thinking state animations (breathing with glow)
- Mode-specific styles (Geek green, Evolution purple)
- Performance optimizations (memo, static classes, GPU acceleration)

Also updates ChatMessages, ChatHeader, PartnerGreeting to use the new
AnimatedAvatar component instead of static avatar images.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor(web): remove debug logs and update mode placeholders

- Remove console.log debug statements from ModeCycleButton and AIChat
- Update Geek/Evolution mode chat placeholders to be more descriptive
- Add i18n keys for mode-specific greetings and prompts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor(web): remove debug logging from RPC and components

- Remove console.log from Connect RPC interceptors
- Simplify timeout interceptor (remove redundant logging)
- Remove unused useAIQueries debug code
- Fix MasonryColumn layout (remove unnecessary max-width)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* perf(web): optimize header SVG files

Remove redundant paths and simplify SVG structure for smaller bundle size.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(ui): add mode-aware greetings for Geek/Evolution modes

- PartnerGreeting now displays mode-specific greetings and prompts
- Geek Mode: "终端已连接" with code-focused suggestions
- Evolution Mode: "进化模式已激活" with improvement-focused prompts
- ChatHeader: migrate hardcoded status text to i18n
- Optimize: remove unnecessary useMemo for timeConfig
- Fix: hide "Claude Code" implementation detail from UI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(web): remove unused variables in ChatMessages

- Remove unused lastItemsLengthRef
- Remove unused startTime variable

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(web): resolve TypeScript errors

- Remove unused variables (lastItemsLengthRef, startTime, isPinned)
- Remove unused imports (useState in StreamingMarkdown)
- Fix CapabilityType enum usage (use value import, not type-only)
- Fix unused parameters (prefix with _ for intentionally unused)
- Remove unused onDismiss from inner components

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(evolution): correct UUID format for session namespace

The format string %04x produces only 4 hex digits, resulting in
invalid 28-character UUID. Changed to %012x to produce
valid 36-character UUID format.

Fixes panic: "uuid: Parse(...): invalid UUID length: 28"

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* style: apply Biome formatting to AnimatedAvatar files

- Fix import order (react imports before local)
- Apply code formatting (indentation, line breaks)
- Resolves CI static-checks failures

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* style: apply Biome formatting and fix type issues

- Fix parrotId type in StreamingMarkdown (string → ParrotAgentType)
- Add biome-ignore comment for protobuf workaround in useAIQueries
- Apply Biome auto-format to all affected files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: add lint workflow section to CLAUDE.md

- Add Lint 工作流 section with frontend/backend commands
- Document pre-commit hook behavior
- Add Biome format issues to debugging lessons

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: add Evolution Mode to README and ARCHITECTURE

- Add Evolution Parrot as 5th agent in agent table
- Add comparison table for Geek Mode vs Evolution Mode
- Clarify positioning: Geek Mode helps users, Evolution Mode evolves the system
- Update AI agent architecture diagram with Evolution Mode priority routing
- Add EvolutionMode to ARCHITECTURE.md agent types and routing docs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: clarify Geek Mode vs Evolution Mode positioning

Based on EVOLUTION_MODE_SPEC.md:

- Add work directory and output columns to agent table
- Add detailed comparison table (定位/目标用户/工作目录/产出/安全等级/视觉风格)
- Update spec reference to point to EVOLUTION_MODE_SPEC.md
- Remove redundant comparison section, replace with routing priority
- Update ARCHITECTURE.md with work directory, output, and security level details

Key distinctions:
- Geek Mode: 通用任务助手 → 用户沙箱 → 用户下载产物
- Evolution Mode: 系统自我进化引擎 → 源代码根目录 → GitHub PR

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test(agent): skip EvolutionParrot tests when Claude Code CLI not available

- Add skipIfNoCLI() helper function
- Skip tests requiring CLI if 'claude' command not found in PATH
- This allows CI to pass without installing Claude Code CLI

Tests that now skip when CLI unavailable:
- TestNewEvolutionParrot
- TestEvolutionParrotPermissionDenied
- TestEvolutionParrotSetDeviceContext
- TestEvolutionParrotSelfDescribe
- TestEvolutionParrotResetSession
- TestEvolutionParrotCancel
- TestEvolutionParrotAdminOnlyEnvVar
- TestEvolutionParrotCallbackError

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: update .gitignore and remove tracked generated files

- Add Go test/coverage files: coverage.out, coverage.html, *.test, *.prof
- Add debug binaries: __debug_bin*
- Add Air live reload: .air.toml, tmp/
- Add Qoder cache: .qoder/
- Remove previously tracked coverage.out and .qoder/ from git index

---------

Co-authored-by: Test User <test@example.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
hrygo pushed a commit that referenced this pull request Feb 7, 2026
- Add missing i18n keys for block number display
- Fix handleEditConfirm to log instead of silently discarding edits
- Add localStorage error logging in CompactToolCall
- Remove unused props (blockId, conversationId) from BlockEditDialog
- Update useBlockEditDialog hook signature
- Add comprehensive test coverage for BranchIndicator
- Add edge case tests for blockNumber (0, negative, large)
- Fix test selectors and remove unused imports

Refs #3 (PR review fixes)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hrygo pushed a commit that referenced this pull request Feb 7, 2026
- Add missing i18n keys for block number display
- Fix handleEditConfirm to log instead of silently discarding edits
- Add localStorage error logging in CompactToolCall
- Remove unused props (blockId, conversationId) from BlockEditDialog
- Update useBlockEditDialog hook signature
- Add comprehensive test coverage for BranchIndicator
- Add edge case tests for blockNumber (0, negative, large)
- Fix test selectors and remove unused imports

Refs #3 (PR review fixes)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hrygo added a commit that referenced this pull request Feb 7, 2026
… routing improvements (#120)

* refactor(chat): simplify branching to block number display

- Replace branch path (A, B, C...) with sequential block numbers (1, 2, 3...)
- Update BranchIndicator to show BlockNumberBadge with Hash icon
- Remove branch creation UI from BlockEditDialog
- Remove all branch-related props from BlockHeader and UnifiedMessageBlock
- Keep database fields (parent_block_id, branch_path) reserved but unused

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(hooks): remove invalid --silent flag from pnpm lint:fix

The lint:fix script doesn't accept --silent parameter, causing
pre-commit hook to fail even when lint passes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(chat): remove optimistic update to eliminate block creation flicker

The optimistic update in useCreateBlock was causing a visual flicker
where an empty pending block would momentarily appear before being
replaced by the actual block from the server.

Changed to wait for server response before updating the cache, which
provides a smoother UX without the intermediate empty state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(chat): align ErrorSection timeline icon position with other sections

Fixed inconsistent ErrorSection UI where the error icon was not
properly positioned on the timeline. Now uses the same
`absolute -left-[2rem] top-0` positioning as other sections
(Thinking, ToolCall, Answer).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(agent): handle empty query in memo_search for "list all" requests

When user asks "有什么笔记" (what notes do you have), the LLM
generates an empty query parameter, causing tool execution failure.

Changes:
1. memo_search tool: Treat empty query as "search all" (using "*" wildcard)
2. MemoParrot prompt: Add explicit examples for searching all notes
   - query: "*" for listing all memos
   - query: "Python" for keyword search

This allows natural "list all" queries to work without errors.

Fixes: ai.agent.event error "query cannot be empty"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(chat): fix PR review issues

- Add missing i18n keys for block number display
- Fix handleEditConfirm to log instead of silently discarding edits
- Add localStorage error logging in CompactToolCall
- Remove unused props (blockId, conversationId) from BlockEditDialog
- Update useBlockEditDialog hook signature
- Add comprehensive test coverage for BranchIndicator
- Add edge case tests for blockNumber (0, negative, large)
- Fix test selectors and remove unused imports

Refs #3 (PR review fixes)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(ai): add intelligent memo query routing (SQL vs Vector)

This optimization eliminates unnecessary vector search for list/filter queries.

**Problem**:
All memo queries were routed through semantic vector search,
including simple list queries like "有什么笔记" which should use SQL.

**Solution**:
Added a 4-layer query intent classifier:
- Layer 1: List intent (0ms) → "有什么笔记" → SQL list
- Layer 2: Filter intent (0ms) → "今天的笔记" → SQL filter
- Layer 3: Keyword intent (0ms) → "Python" → BM25
- Layer 4: Semantic default → "如何部署" → Vector

**New retrieval strategies**:
- `memo_list_only`: Pure SQL list (fastest, ~10ms)
- `memo_filter_only`: SQL with time filter
- `memo_bm25_only`: BM25 keyword search (no embedding)
- `memo_semantic_only`: Vector search (existing)

**Performance impact**:
| Query | Before | After |
|-------|--------|-------|
| "有什么笔记" | ~500ms (Embedding) | ~10ms (SQL) |

Refs #8

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(tools): use unicode property class for Chinese characters in regex

Replace `\u4e00-\u9fff` with `\p{Han}` for proper Unicode
character class matching in Go regexp.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(chat): prevent block creation flicker by predicting roundNumber

- Use predicted roundNumber (existing blocks count + 1) for optimistic block
- Remove refetchBlocks() call after streaming completion
- The streaming handler already updates block via optimistic updates

This eliminates the flicker caused by:
1. Optimistic block with roundNumber=0 appearing briefly
2. Then being replaced by backend data with correct roundNumber
3. Then refetchBlocks() triggering another re-render

Now the optimistic block appears with the correct roundNumber immediately,
and no additional refetch is needed since all data is already streamed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(ui): remove animation effects during block creation

Remove fade-in, slide-in, and pulse animations that were causing
visual "flicker" effects during streaming block creation.

Changes:
- Remove animate-in fade-in slide-in-from-top-1 from tool details expansion
- Remove animate-in fade-in from thinking content expansion
- Remove animate-pulse from running tool timeline node
- Remove animate-pulse from streaming answer timeline node
- Remove animate-in fade-in from pending state initialization
- Remove animate-block-pulse from streaming block container

Retain animate-spin for Loader2 components (spinner icons).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(ui): remove block breathing animation during creation

Remove animate-block-pulse from streaming block container to prevent
visual flicker/breathing effect during block creation.

Other animations (fade-in, slide-in, pulse for timeline nodes) are
preserved as they provide meaningful UI feedback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(ai): optimize memo query routing with intent classification

Implement intelligent query routing to use SQL for list/filter queries
instead of forcing all queries through vector search.

Changes:
- Add MemoQueryClassifier with 4-layer intent classification:
  * IntentList: List all memos ("有什么笔记", "*", etc.)
  * IntentFilter: Time/tag filters ("今天的笔记", "#work")
  * IntentKeyword: Simple keywords (BM25 search)
  * IntentSemantic: Complex semantic queries (vector search)

- Add 3 new retrieval strategies in AdaptiveRetriever:
  * memo_list_only: Pure SQL list (fastest)
  * memo_filter_only: SQL with time filter using CEL
  * memo_bm25_only: BM25 keyword search without embedding

- Fix semantic query classification by reordering checks:
  * Check semantic patterns before short query pattern
  * Prevents "如何部署服务" from being classified as keyword

- Add comprehensive unit tests for query classifier

- Remove duplicate time range extraction code
- Add timeout error handling with DeadlineExceeded check

Refs #119

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(chat): remove placeholder text from thinking events

Fix the issue where thinking placeholder text like "正在思考..."
was displayed as actual content in the Block's thinking section.

Root cause: Backend was sending hardcoded Chinese text as thinking
event content, which frontend couldn't distinguish from real content.

Changes:
- MemoParrot: Use "ai.states.thinking" key instead of "正在思考..."
- AmazingParrot: Use "ai.states.thinking" key instead of "正在分析您的需求..."
- UnifiedMessageBlock: Dynamically build placeholder filter list
  from i18n translations to catch all translated placeholders

This ensures placeholder texts are filtered out from display,
showing only genuine thinking content.

Ref: Frontend already had translateThinkingSteps() to handle i18n keys.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(chat): show thinking section even when content is placeholder only

Fix the issue where thinking section was not displayed when the only
thinking content was placeholder text (e.g., "ai.states.thinking").

The problem was that the display condition checked `allThinkingContent.length > 0`,
but `allThinkingContent` is filtered to exclude placeholders, causing the section
to be hidden even when `thinkingSteps` existed.

Changes:
- Show thinking section when `thinkingSteps.length > 0` OR `streamingPhase === "thinking"`
- Only allow expand/collapse toggle when there is real content
- Only show expanded content view when there is real content

This ensures the thinking section is always visible when thinking events exist,
while the expandable content area only shows non-placeholder content.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor(chat): remove edit button from AI chat footer

Remove the edit button and related edit functionality from the
AI chat Block footer to simplify the UI.

Changes:
- BlockFooter.tsx: Remove edit button, Pencil icon, and onEdit prop
- UnifiedMessageBlock.tsx: Remove onEdit from props and component
- ChatMessages.tsx: Remove edit dialog, handleEdit, and handleEditConfirm
- Update test file to remove onEdit prop

This simplifies the footer UX by removing the unimplemented
edit feature.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* perf(chat): optimize block streaming UI performance

Implement comprehensive performance optimizations for block streaming UI
to achieve smooth, ChatGPT-like typing animation and real-time progress display.

P0 optimizations:
- Replace O(n) array traversal with O(1) Map lookup in useAIQueries.ts
- Switch from StreamingText to StreamingMarkdown for sentence-level rendering
- Leverage React 18 automatic batching instead of dual cache updates

P1 optimizations:
- Merge 6 useEffect hooks into 2 unified scroll handlers in ChatMessages.tsx
- Add smart caching for messageBlocks conversion to avoid re-processing history
- Reduce scroll trigger threshold from 50 to 15 characters for better responsiveness

Type safety improvements:
- Fix BlockBodyProps.parrotId type from string to ParrotAgentType enum
- Use enum constants (ParrotAgentType.GEEK/EVOLUTION) instead of string literals
- Fix BlockEvent to use 'meta' instead of 'metadata' field

i18n fixes:
- Add missing 'block_number' translation key to en.json and zh-Hant.json
- Remove duplicate 'block_number' key in zh-Hant.json

Refs #119

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: 黄飞虹 <aaronwong1989@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant