Skip to content

Commit dea3d04

Browse files
authored
Merge pull request #10 from micilini/phase-11-fix-fragmented-file-frames
Phase 11 fix fragmented file frames
2 parents c3d6856 + 9ec35ee commit dea3d04

34 files changed

Lines changed: 3975 additions & 52 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ desktop.ini
3232
/storage/*.sqlite
3333
/storage/*.sqlite3
3434
/storage/*.db
35+
/storage/attachments/
3536
/examples/**/storage/*.sqlite
3637
/examples/**/storage/*.sqlite3
3738
/examples/**/storage/*.db
39+
/examples/**/storage/attachments/
3840

3941
node_modules/
4042
npm-debug.log*

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,43 @@ $pdo = PdoConnectionFactory::sqlite(__DIR__ . '/storage/phpsockets.sqlite');
151151

152152
The CLI migration command will be added in a future phase.
153153

154+
## Emoji and small attachment support
155+
156+
The chat examples support a composer action button next to the message input.
157+
158+
Users can:
159+
160+
- Insert emojis from a small built-in emoji picker.
161+
- Send small files up to the configured limit.
162+
- Send image previews, PDFs and text files.
163+
- Keep message rendering safe with `textContent`.
164+
165+
The initial attachment transport uses JSON text-frame envelopes with base64 payloads over WebSocket. The chat core does not accept binary WebSocket frames for chat messages in this version. Larger uploads and chunked binary frames are planned for future versions.
166+
167+
## Attachment composer behavior
168+
169+
Selecting a file does not send it immediately.
170+
171+
The selected file appears as a pending attachment in the composer. The user can add a text caption and click `Send`.
172+
173+
Supported files:
174+
175+
```txt
176+
image/png
177+
image/jpeg
178+
image/gif
179+
application/pdf
180+
text/plain
181+
```
182+
183+
Default max file size:
184+
185+
```txt
186+
2 MB
187+
```
188+
189+
Each delivered file message includes a download button.
190+
154191
## Requirements
155192

156193
The modern version targets:

examples/easy-chat/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,56 @@ This example is intentionally simple.
9191
Message receipts are browser-only example receipts. They are not persisted and do not represent a full per-user room read history.
9292

9393
It only demonstrates the global chat flow. Private direct messages and private group rooms will be demonstrated in later examples.
94+
95+
## Composer actions
96+
97+
The message input includes a left-side action button.
98+
99+
It opens:
100+
101+
- Emoji picker.
102+
- File picker.
103+
104+
Allowed files:
105+
106+
```txt
107+
image/png
108+
image/jpeg
109+
image/gif
110+
application/pdf
111+
text/plain
112+
```
113+
114+
Default max size:
115+
116+
```txt
117+
2 MB
118+
```
119+
120+
All user-provided text continues to be rendered safely.
121+
122+
## Attachment composer behavior
123+
124+
Selecting a file does not send it immediately.
125+
126+
The selected file appears as a pending attachment in the composer. The user can add a text caption and click `Send`.
127+
128+
Supported files:
129+
130+
```txt
131+
image/png
132+
image/jpeg
133+
image/gif
134+
application/pdf
135+
text/plain
136+
```
137+
138+
Default max file size:
139+
140+
```txt
141+
2 MB
142+
```
143+
144+
Each delivered file message includes a download button.
145+
146+
Attachments are transported as JSON text-frame envelopes with base64 content. The chat core does not accept binary WebSocket frames for chat messages in this version.

0 commit comments

Comments
 (0)