Skip to content

Commit f440e90

Browse files
authored
Merge pull request #13 from kubit-ui/feat/kubito-behavior
2 parents ee69ce3 + bbbe692 commit f440e90

File tree

15 files changed

+462
-162
lines changed

15 files changed

+462
-162
lines changed

ARCHITECTURE.md

Lines changed: 55 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ media/
1313
├── kubito.css # Webview styles
1414
├── kubito.js # Compiled JavaScript from TypeScript
1515
├── kubito.js.map # Source map for debugging
16-
├── kubito_walking.gif # Walking animation
17-
├── kubito_jumping.gif # Jumping animation
18-
├── kubito_idle.png # Idle sprite
19-
├── kubit_logo.png # Custom message icon
20-
└── kubit_love.png # Custom message icon
16+
├── kubito-walking.gif # Walking animation
17+
├── kubito-jumping.gif # Jumping animation
18+
├── kubito-idle.gif # Idle animation
19+
├── kubit-logo.png # Custom message icon
20+
└── kubit-love.png # Custom message icon
2121
2222
out/ # Compiled extension files
2323
└── extension.js # Compiled backend
@@ -44,46 +44,73 @@ out/ # Compiled extension files
4444

4545
### **3. Message System**
4646

47-
- **Auto-generation**: Messages appear every 5-10 seconds
47+
- **Auto-generation**: Messages appear every 3-7 seconds
4848
- **Dynamic Following**: Speech bubbles follow Kubito as he moves
4949
- **Smart Positioning**: Messages trigger direction changes to avoid edge
5050
collisions
5151
- **Priority Handling**: Jump interactions cancel active messages
5252
- **Content Types**: Emojis, text, and custom Kubit team images
5353

54-
## 🎨 Animation States
54+
## 🎨 Animation States & Movement System
5555

56-
### **State Machine**
56+
### **Enhanced State Machine**
5757

5858
```
59-
Walking ──click──→ Jumping ──1s──→ Idle ──300ms──→ Walking
60-
↑ ↓
61-
└─────────── Message Display (follows) ←──────────┘
59+
WANDERING ──timer(3-5s)──→ PAUSED ──timer(1-2.5s)──→ WANDERING
60+
↑ ↓ ↑
61+
└── Message Display ──────┼── TALKING ──timer(3s)────┘
62+
63+
Jump(20% chance)
64+
65+
JUMPING ──800ms── → back to appropriate state
6266
```
6367

68+
### **Kubito States (KubitoState enum)**
69+
70+
- **WANDERING**: Active movement at 0.15px/frame with boundary detection
71+
- **PAUSED**: Stationary state lasting 1-2.5 seconds, safe zone for messages
72+
- **JUMPING**: 800ms autonomous jump animation with cooldown system
73+
- **TALKING**: Message display state with Kubito paused and speech bubble following
74+
6475
### **Sprite Management**
6576

66-
- **Walking State**: `kubito_walking.gif` - Continuous movement
67-
- **Jumping State**: `kubito_jumping.gif` - 1-second jump animation
68-
- **Idle State**: `kubito_idle.png` - 300ms static sprite after landing
77+
- **Walking State**: `kubito-walking.gif` - Smooth continuous movement animation
78+
- **Jumping State**: `kubito-jumping.gif` - 800ms jump sequence with landing
79+
- **Idle State**: `kubito-idle.gif` - Idle animation
6980
- **Direction Classes**: `walking-right` / `walking-left` for CSS transforms
7081

82+
### **Smart Timing System**
83+
84+
- **Wandering Duration**: 3-5 seconds of active movement
85+
- **Pause Duration**: 1-2.5 seconds
86+
- **Jump Probability**: 20% chance when entering pause state
87+
- **Message Safe Zone**: 90% center area for optimal visibility
88+
- **Jump Cooldown**: 1-second buffer prevents message conflicts
89+
7190
## 🔄 Event Flow
7291

73-
### **User Interaction**
92+
### **Autonomous Movement**
7493

75-
1. User clicks Kubito → Cancel any active message
76-
2. Switch to jumping sprite → Set jumping state
77-
3. After 1s → Switch to idle sprite for 300ms
78-
4. Return to walking sprite → Resume movement
94+
1. **Wandering Phase**: Kubito moves at 0.15px/frame for 3-5 seconds
95+
2. **Transition to Pause**: Natural deceleration to stationary state
96+
3. **Pause Phase**: 1-2.5 seconds of idle animation in safe zone
97+
4. **Optional Jump**: 20% probability of autonomous jump with 800ms animation
98+
5. **Message Opportunity**: Messages only appear during pause in safe zone
99+
6. **Return to Wandering**: Cycle continues with potential direction changes
79100

80-
### **Message Lifecycle**
101+
### **Smart Message System**
81102

82-
1. Timer triggers (5-10s random) → Check if not jumping
83-
2. Show speech bubble → Set showing message state
84-
3. Follow Kubito's movement → Update bubble position each frame
85-
4. Check edge collision → Change Kubito direction if needed
86-
5. After 3s → Fade out bubble → Reset message state
103+
1. Timer triggers (3-7s random) → Validate conditions (paused + safe zone + no jump cooldown)
104+
2. Show speech bubble → Transition to TALKING state
105+
3. Follow Kubito's position → Maintain bubble alignment during pause
106+
4. Smart positioning → Prevent edge collisions with expanded safe zone
107+
5. After 3s → Fade out bubble → Brief pause before returning to wandering
108+
109+
### **Performance Optimizations**
110+
111+
1. **Efficient DOM Updates**: State tracking prevents unnecessary image changes
112+
2. **Frame-perfect Timing**: RequestAnimationFrame ensures 60fps smoothness
113+
3. **Memory Management**: Proper event cleanup and state management
87114

88115
## 🔧 Build Process
89116

@@ -104,10 +131,9 @@ vsce package # Creates .vsix file
104131

105132
## 🎯 Performance Optimizations
106133

107-
- **60fps Animation Loop**: RequestAnimationFrame for smooth movement
108-
- **Efficient Updates**: Only update bubble position when message is active
109-
- **State Guards**: Prevent redundant operations with state checks
110-
- **Relaxed Speed**: 0.3px/frame for comfortable interaction
134+
- **60fps Animation Loop**: RequestAnimationFrame for smooth movement with intelligent state transitions
135+
- **Efficient State Updates**: KubitoState enum eliminates redundant DOM operations
136+
- **Optimized Movement Speed**: 0.15px/frame for natural, comfortable interaction
111137
- **Minimal DOM Manipulation**: Reuse elements when possible
112138

113139
## 🔒 Security Considerations
@@ -117,22 +143,9 @@ vsce package # Creates .vsix file
117143
- **CSP Compliance**: Content Security Policy for web resources
118144
- **No External Dependencies**: All resources bundled locally
119145

120-
## 🆕 v1.0.0 Features
121-
122-
- **Professional Structure**: Follows Microsoft VS Code extension standards
123-
- **Comprehensive Testing**: 16 test cases covering all functionality
124-
- **Interactive Jumping**: Click-to-jump with priority over messages
125-
- **Smart Message Following**: Bubbles track Kubito's movement
126-
- **Collision Intelligence**: Direction changes to prevent edge collisions
127-
- **Multi-sprite System**: Walking, jumping, and idle animations
128-
- **Optimized Timing**: Improved animation speeds and durations
129-
- **Enhanced UX**: Hover effects and visual feedback
130-
- **Open Source Ready**: Clean code structure and documentation
131-
132146
## 📝 Development Notes
133147

134148
- **TypeScript First**: Both backend and frontend use TypeScript
135-
- **Modular Design**: Clear separation between animation, messaging, and
136149
interaction
137150
- **Extensible**: Easy to add new sprites, messages, or behaviors
138151
- **VS Code Standards**: Follows VS Code extension development best practices

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to
77
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
## [2.3.0] - 2025-11-13
10+
11+
### ✨ Enhanced Movement & Animation System
12+
13+
- **🎮 Natural Wandering Behavior** - Kubito now follows realistic movement patterns with alternating wandering and pause states
14+
- **⚡️ Optimized Movement Speed** - Reduced movement speed from 0.2 to 0.15 pixels/frame for more natural, relaxed pacing
15+
- **🔄 Smart State Management** - New KubitoState system (WANDERING, PAUSED, JUMPING, TALKING) with intelligent transitions
16+
- **🎪 Autonomous Jump Behavior** - Kubito now occasionally jumps on his own with 20% probability during pause states
17+
18+
19+
### 🛠️ Technical Improvements
20+
- **🏗️ Better Architecture** - Clean separation between movement states, timing logic, and visual updates
21+
- **🎯 Message Logic** - Smart timing ensures messages only appear during paused state in safe zone (3-7 second intervals)
22+
- **⏱️ Jump Cooldown** - 1-second cooldown after jumps prevents message conflicts
23+
- **🎨 Asset Consistency** - Renamed assets from `kubito_*` to `kubito-*` format for consistency
24+
925
## [2.2.0] - 2025-11-12
1026

1127
### ✨ Editor and Git Event Reactions

README.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,30 @@
99
## ✨ What Kubito Does
1010

1111
- 🤖 **Walks Around**: Kubito continuously walks back and forth in your Explorer
12-
sidebar
13-
- 🦘 **Interactive Fun**: Click on Kubito to make him jump with special
14-
animations
12+
- 🦘 **Autonomous Fun**: Kubito jumps, talks and pauses randomly
1513
- 💬 **Smart Messages**: Context-aware messages that adapt to time and day
1614
(Monday Blues, Friday Feeling, Working Late)
15+
- 📁 **Development Reactions**: Kubito reacts to your coding activities - file saves, Git commits, and pushes with contextual messages
1716
- 🌍 **6 Languages**: Full support for English, Spanish, French, German,
1817
Portuguese, and Italian
19-
- 🎯 **Smart Behavior**: Kubito cleverly avoids edges and follows his own path
20-
-**Delightful Details**: Beautiful hover effects and smooth animations
18+
2119

2220
## 🚀 Getting Started
2321

2422
1. **Install** → Search "Kubito" in VS Code Extensions and click Install
25-
2. **Find Him** → Look for "Kubito" section in your Explorer sidebar (left
26-
panel)
27-
3. **Expand** → Click to expand if collapsed and watch Kubito start walking
28-
4. **Interact**: Click on Kubito to make him jump and watch for random messages!
23+
2. **Find Him** → Look for "Kubito" section in your Explorer sidebar (left panel)
24+
3. **Expand & Watch** → Click to expand if collapsed and watch Kubito start walking
25+
4. **Code!**: Kubito reacts to your development workflow - save files, commit, or push to Git and see his responses!
2926

3027
## 🎮 How to Interact
3128

3229
| Action | What Happens |
3330
| ---------------------- | ----------------------------------------------- |
34-
| 🖱️ **Click Kubito** | He jumps with a cute animation! |
3531
| 👀 **Hover over him** | See a nice glow effect |
36-
|**Wait and watch** | Context-aware messages appear automatically |
32+
|**Watch and wait** | Kubito autonomously walks, pauses, and jumps |
33+
| 💾 **Save a file** | Kubito shows encouraging save reactions |
34+
|**Git commit** | Kubito celebrates your commits with messages |
35+
| 🚀 **Git push** | Kubito cheers when you push your code! |
3736
| 🌍 **Change language** | Messages adapt to your preferred language |
3837
| 📁 **Expand/Collapse** | Control Kubito's section like any sidebar panel |
3938

@@ -42,10 +41,17 @@
4241
Access in: `Settings > Extensions > Kubito`
4342

4443
- **Auto Show** → Automatically show Kubito when opening VS Code _(default: on)_
45-
- **Language** → Choose from 6 languages or auto-detect from VS Code _(default:
46-
auto)_
47-
- **Contextual Messages** → Show time and day-appropriate messages _(default:
48-
on)_
44+
- **Language** → Choose from 6 languages or auto-detect from VS Code _(default: auto)_
45+
- **Contextual Messages** → Show time and day-appropriate messages _(default: on)_
46+
47+
### 🎬 Event Reactions
48+
Configure Kubito's responses to your development activities:
49+
50+
- **File Save Reactions** → Show reactions when saving files _(default: on)_
51+
- **Git Commit Reactions** → Show reactions when making Git commits _(default: on)_
52+
- **Git Push Reactions** → Show reactions when pushing to Git remotes _(default: on)_
53+
54+
> 💡 **Tip**: Use the `Kubito: Configure Event Reactions` command to quickly access these settings!
4955
5056
## 🎬 Demo
5157

@@ -54,11 +60,11 @@ animations and interactions!_
5460

5561
## 💡 Tips & Tricks
5662

57-
- **Can't see Kubito?** Make sure your Explorer panel is open (folder icon in
58-
sidebar)
63+
- **Can't see Kubito?** Make sure your Explorer panel is open (folder icon in sidebar)
5964
- **Section collapsed?** Click the arrow next to "Kubito" to expand
6065
- **Want more space?** You can resize the Explorer panel by dragging its edge
61-
- **Kubito seems stuck?** Try clicking him - he loves attention!
66+
- **Too many reactions?** You can disable file save, commit, or push reactions in Settings → Extensions → Kubito
67+
- **Want to see event reactions?** Try saving a file or making a Git commit - Kubito will celebrate with you!
6268

6369
## 🤝 Support & Feedback
6470

media/kubito-idle.gif

6.01 KB
Loading

media/kubito.css

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ body {
2323
left: 0;
2424
width: 36px;
2525
height: 36px;
26-
image-rendering: pixelated;
27-
image-rendering: -moz-crisp-edges;
28-
image-rendering: crisp-edges;
2926
transition: filter 0.3s ease;
3027
z-index: 999;
3128
cursor: pointer;

media/kubito_idle.png

-10.6 KB
Binary file not shown.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
"clean": "rm -rf out"
141141
},
142142
"devDependencies": {
143+
"@eslint/js": "^9.39.1",
143144
"@types/glob": "^9.0.0",
144145
"@types/mocha": "^10.0.10",
145146
"@types/node": "^24.9.1",

0 commit comments

Comments
 (0)