Commit c6a9981
authored
feat: Add User Nickname System with Validation and Edit Functionality (#16)
* feat: Add user nickname system with validation modal
- Implemented beautiful welcome modal for nickname input
- Added comprehensive client and server-side validation (3-20 chars, alphanumeric+underscore, unique)
- Enhanced WebSocket protocol to handle nickname as first message
- Updated ConnectionManager to track and validate nicknames
- Modified UI to display nicknames instead of numeric IDs
- Added join/leave messages with user nicknames and emojis
- Maintained 100% backward compatibility with CDC functionality
- Fixed bug in consumer.py for unhandled CDC operation types
- Added real-time validation feedback and error handling
- Implemented smooth animations and mobile-responsive design
This feature allows users to personalize their chat identity with validated nicknames, improving user experience while maintaining all existing CDC and chat functionality.
* feat: Add localStorage persistence and Change Nickname button
- Nickname now persists across page refreshes using localStorage
- Added 'Change Nickname' button in header for easy nickname updates
- Auto-reconnect with saved nickname on page load
- Server validates uniqueness on each connection
- Clear localStorage and reconnect when changing nickname
- Improved UX: users only set nickname once per browser
- Export changeNickname to window for global access
* feat: Add user nickname system with validation and edit functionality
- Add nickname modal on page load with purple gradient theme
- Implement backend nickname validation (2-20 chars, alphanumeric + spaces/underscores/hyphens)
- Add uniqueness check to prevent duplicate nicknames
- Display nicknames in messages and header instead of client IDs
- Add edit nickname button for easy nickname changes
- Include real-time character counter and error handling
- Maintain existing CDC functionality and UI consistency
- Ask for nickname on every page refresh (no persistence)
Resolves issue: User Nickname System feature request
Hacktoberfest 2025 contribution1 parent 5f47f4f commit c6a9981
File tree
6 files changed
+425
-17
lines changed- app
- internal
- routes
- static
- templates
6 files changed
+425
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | | - | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
| 31 | + | |
24 | 32 | | |
25 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
26 | 39 | | |
27 | 40 | | |
28 | 41 | | |
29 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
12 | 36 | | |
13 | | - | |
14 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
15 | 49 | | |
16 | 50 | | |
17 | 51 | | |
18 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
19 | 56 | | |
20 | 57 | | |
21 | 58 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | | - | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
14 | 99 | | |
15 | 100 | | |
16 | | - | |
17 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
18 | 110 | | |
19 | 111 | | |
20 | 112 | | |
21 | 113 | | |
22 | | - | |
| 114 | + | |
23 | 115 | | |
24 | 116 | | |
25 | 117 | | |
| |||
29 | 121 | | |
30 | 122 | | |
31 | 123 | | |
32 | | - | |
33 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
34 | 136 | | |
35 | 137 | | |
36 | 138 | | |
| |||
44 | 146 | | |
45 | 147 | | |
46 | 148 | | |
47 | | - | |
| 149 | + | |
48 | 150 | | |
49 | 151 | | |
50 | 152 | | |
51 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
52 | 165 | | |
53 | 166 | | |
54 | 167 | | |
| |||
191 | 304 | | |
192 | 305 | | |
193 | 306 | | |
194 | | - | |
| 307 | + | |
195 | 308 | | |
196 | 309 | | |
197 | 310 | | |
| |||
251 | 364 | | |
252 | 365 | | |
253 | 366 | | |
| 367 | + | |
| 368 | + | |
0 commit comments