feat: add user display profiles and fix web context menu UX
Some checks failed
CI / test (push) Failing after 17s
Some checks failed
CI / test (push) Failing after 17s
backend: - add required user name and optional bio fields - extend auth/register and user schemas/services with name/bio - add alembic migration 0006 with safe backfill name=username - compute per-user chat display_title for private chats - keep Saved Messages delete-for-all protections web: - registration now includes name - add profile edit modal (name/username/bio/avatar url) - show private chat names via display_title - fix context menus to open near cursor with viewport clamping - stabilize +/close floating button to remove visual jump
This commit is contained in:
@@ -70,7 +70,8 @@ export function MessageList() {
|
||||
}`}
|
||||
onContextMenu={(e) => {
|
||||
e.preventDefault();
|
||||
setCtx({ x: e.clientX, y: e.clientY, messageId: message.id });
|
||||
const pos = getSafeContextPosition(e.clientX, e.clientY, 160, 108);
|
||||
setCtx({ x: pos.x, y: pos.y, messageId: message.id });
|
||||
}}
|
||||
>
|
||||
{message.forwarded_from_message_id ? (
|
||||
@@ -147,3 +148,13 @@ function renderStatus(status: string | undefined): string {
|
||||
if (status === "read") return "✓✓";
|
||||
return "✓";
|
||||
}
|
||||
|
||||
function getSafeContextPosition(x: number, y: number, menuWidth: number, menuHeight: number): { x: number; y: number } {
|
||||
const pad = 8;
|
||||
const cursorOffset = 4;
|
||||
const wantedX = x + cursorOffset;
|
||||
const wantedY = y + cursorOffset;
|
||||
const safeX = Math.min(Math.max(pad, wantedX), window.innerWidth - menuWidth - pad);
|
||||
const safeY = Math.min(Math.max(pad, wantedY), window.innerHeight - menuHeight - pad);
|
||||
return { x: safeX, y: safeY };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user