Messages: Facebook-style Chats panel and docked chat windows
DevPlace CI / test (pull_request) Failing after 1h7m10s
DevPlace CI / test (pull_request) Failing after 1h7m10s
The topnav Messages icon opens a Chats panel (people search, recent conversations, New message, link to the full page). Picking a person opens a small chat window docked bottom-right; windows minimize to avatar heads with unread counts and survive navigation within the tab. Profile Send Message, the live message toast and message notifications on /notifications open the same window. Phones and /messages keep the full page. Each window is dp-chat in mode="window", sharing one WebSocket through chat/ChatSocketHub.js; chat/ConversationItem.js is the shared row builder. No server changes. The message input becomes [+] [text + emoji] [send] everywhere: + reveals the attach and GIF buttons, which tuck away while typing. Also fixes linked toasts never receiving clicks (pointer-events). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -764,10 +764,46 @@ def test_message_notification_click_opens_conversation(app_server, browser, seed
|
||||
card = pa.locator(".notification-card").filter(has_text="sent you a message").first
|
||||
card.wait_for(state="visible", timeout=10000)
|
||||
card.locator("a.card-link").click()
|
||||
pa.wait_for_url("**/messages**", timeout=10000, wait_until="domcontentloaded")
|
||||
assert "with_uid=" in pa.url, (
|
||||
f"message notification should open the conversation: {pa.url}"
|
||||
from devplacepy.database import get_table
|
||||
|
||||
bob_uid = get_table("users").find_one(username=seeded_db["bob"]["username"])["uid"]
|
||||
window = pa.locator(f".chat-window[data-chat-uid='{bob_uid}']")
|
||||
window.locator(".message-bubble:has-text('Click-through message from bob')").first.wait_for(
|
||||
state="visible", timeout=10000
|
||||
)
|
||||
assert pa.url.endswith("/notifications"), (
|
||||
f"a message notification should open the docked chat window in place: {pa.url}"
|
||||
)
|
||||
|
||||
ctx_a.close()
|
||||
ctx_b.close()
|
||||
|
||||
|
||||
def test_message_notification_click_on_mobile_opens_conversation_page(app_server, browser, seeded_db):
|
||||
from tests.conftest import login_user
|
||||
|
||||
ctx_a = browser.new_context(viewport={"width": 412, "height": 840}, has_touch=True)
|
||||
ctx_b = browser.new_context(viewport={"width": 1400, "height": 900})
|
||||
pa = ctx_a.new_page()
|
||||
pb = ctx_b.new_page()
|
||||
pa.set_default_timeout(15000)
|
||||
pb.set_default_timeout(15000)
|
||||
|
||||
login_user(pa, seeded_db["alice"])
|
||||
login_user(pb, seeded_db["bob"])
|
||||
|
||||
pb.goto(f"{BASE_URL}/messages?search=alice_test", wait_until="domcontentloaded")
|
||||
msg_input = pb.locator("textarea[name='content']").first
|
||||
msg_input.wait_for(state="visible", timeout=10000)
|
||||
msg_input.fill("Mobile click-through message from bob")
|
||||
pb.locator(".messages-input-area button[type='submit']").last.click()
|
||||
pb.wait_for_timeout(1500)
|
||||
|
||||
pa.goto(f"{BASE_URL}/notifications", wait_until="domcontentloaded")
|
||||
card = pa.locator(".notification-card").filter(has_text="sent you a message").first
|
||||
card.wait_for(state="visible", timeout=10000)
|
||||
card.locator("a.card-link").click()
|
||||
pa.wait_for_url("**/messages?with_uid=**", timeout=10000, wait_until="domcontentloaded")
|
||||
|
||||
ctx_a.close()
|
||||
ctx_b.close()
|
||||
|
||||
Reference in New Issue
Block a user