diff --git a/README.md b/README.md index 6844349..0015b00 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ For detailed feature documentation, see the [User Guide](docs/user-guide.md). ## Basic Usage 1. **View messages** - Main page shows chat history with auto-refresh every 10 seconds -2. **Send messages** - Type in the text field and press Enter (140 byte limit) +2. **Send messages** - Type in the text field and press Enter (135 bytes for channels, 150 bytes for DM) 3. **Switch channels** - Use the dropdown in navbar 4. **Direct Messages** - Access via menu (☰) → "Direct Messages" 5. **Manage contacts** - Access via menu (☰) → "Contact Management" diff --git a/app/static/css/style.css b/app/static/css/style.css index 8c76215..8053e53 100644 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -526,6 +526,19 @@ main { color: #dc3545; } +/* DM Action Buttons */ +.dm-actions { + display: flex; + justify-content: flex-end; + margin-top: 0.25rem; +} + +.dm-action-btn { + padding: 0.15rem 0.4rem; + font-size: 0.75rem; + line-height: 1; +} + /* DM Conversation List Item */ .dm-conversation-item { padding: 0.75rem; diff --git a/app/static/js/app.js b/app/static/js/app.js index a69e673..827758e 100644 --- a/app/static/js/app.js +++ b/app/static/js/app.js @@ -702,6 +702,11 @@ function createMessageElement(msg) {
+ `; } else { @@ -834,6 +839,17 @@ function quoteTo(username, content) { input.focus(); } +/** + * Resend a message (paste content back to input) + * @param {string} content - Message content to resend + */ +function resendMessage(content) { + const input = document.getElementById('messageInput'); + input.value = content; + updateCharCounter(); + input.focus(); +} + /** * Load connection status */ @@ -1596,7 +1612,7 @@ function updateCharCounter() { // Count UTF-8 bytes, not Unicode characters const encoder = new TextEncoder(); const byteLength = encoder.encode(input.value).length; - const maxBytes = 140; + const maxBytes = 135; counter.textContent = `${byteLength} / ${maxBytes}`; diff --git a/app/static/js/dm.js b/app/static/js/dm.js index bc8799f..ceade09 100644 --- a/app/static/js/dm.js +++ b/app/static/js/dm.js @@ -418,14 +418,20 @@ function displayMessages(messages) { if (msg.snr !== null && msg.snr !== undefined) { parts.push(`SNR: ${msg.snr.toFixed(1)}`); } - if (msg.path_len !== null && msg.path_len !== undefined) { - parts.push(`Hops: ${msg.path_len}`); - } if (parts.length > 0) { meta = ``; } } + // Resend button for own messages + const resendBtn = msg.is_own ? ` +