Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ desktop.ini
/storage/*.sqlite
/storage/*.sqlite3
/storage/*.db
/storage/attachments/
/examples/**/storage/*.sqlite
/examples/**/storage/*.sqlite3
/examples/**/storage/*.db
/examples/**/storage/attachments/

node_modules/
npm-debug.log*
Expand Down
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,43 @@ $pdo = PdoConnectionFactory::sqlite(__DIR__ . '/storage/phpsockets.sqlite');

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

## Emoji and small attachment support

The chat examples support a composer action button next to the message input.

Users can:

- Insert emojis from a small built-in emoji picker.
- Send small files up to the configured limit.
- Send image previews, PDFs and text files.
- Keep message rendering safe with `textContent`.

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.

## Attachment composer behavior

Selecting a file does not send it immediately.

The selected file appears as a pending attachment in the composer. The user can add a text caption and click `Send`.

Supported files:

```txt
image/png
image/jpeg
image/gif
application/pdf
text/plain
```

Default max file size:

```txt
2 MB
```

Each delivered file message includes a download button.

## Requirements

The modern version targets:
Expand Down
53 changes: 53 additions & 0 deletions examples/easy-chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,56 @@ This example is intentionally simple.
Message receipts are browser-only example receipts. They are not persisted and do not represent a full per-user room read history.

It only demonstrates the global chat flow. Private direct messages and private group rooms will be demonstrated in later examples.

## Composer actions

The message input includes a left-side action button.

It opens:

- Emoji picker.
- File picker.

Allowed files:

```txt
image/png
image/jpeg
image/gif
application/pdf
text/plain
```

Default max size:

```txt
2 MB
```

All user-provided text continues to be rendered safely.

## Attachment composer behavior

Selecting a file does not send it immediately.

The selected file appears as a pending attachment in the composer. The user can add a text caption and click `Send`.

Supported files:

```txt
image/png
image/jpeg
image/gif
application/pdf
text/plain
```

Default max file size:

```txt
2 MB
```

Each delivered file message includes a download button.

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.
Loading
Loading