p0: hide invalid delete action for channel members
All checks were successful
CI / test (push) Successful in 27s
All checks were successful
CI / test (push) Successful in 27s
This commit is contained in:
@@ -20,7 +20,7 @@ Legend:
|
|||||||
11. Forwarding - `PARTIAL` (single + bulk; "without author" missing)
|
11. Forwarding - `PARTIAL` (single + bulk; "without author" missing)
|
||||||
12. Pinning - `DONE` (message/chat pin-unpin)
|
12. Pinning - `DONE` (message/chat pin-unpin)
|
||||||
13. Reactions - `DONE`
|
13. Reactions - `DONE`
|
||||||
14. Delivery Status - `DONE` (sent/delivered/read)
|
14. Delivery Status - `DONE` (sent/delivered/read + reconnect reconciliation after backend restarts)
|
||||||
15. Typing Realtime - `PARTIAL` (typing start/stop done; voice/video typing signals limited)
|
15. Typing Realtime - `PARTIAL` (typing start/stop done; voice/video typing signals limited)
|
||||||
16. Media & Attachments - `DONE` (upload/preview/download/gallery)
|
16. Media & Attachments - `DONE` (upload/preview/download/gallery)
|
||||||
17. Voice Messages - `PARTIAL` (record/send/play/seek/speed; UX still being polished)
|
17. Voice Messages - `PARTIAL` (record/send/play/seek/speed; UX still being polished)
|
||||||
@@ -38,9 +38,9 @@ Legend:
|
|||||||
29. Archive - `DONE`
|
29. Archive - `DONE`
|
||||||
30. Blacklist - `DONE`
|
30. Blacklist - `DONE`
|
||||||
31. Privacy - `PARTIAL` (PM permission + block; full matrix controls still limited)
|
31. Privacy - `PARTIAL` (PM permission + block; full matrix controls still limited)
|
||||||
32. Security - `PARTIAL` (sessions + revoke + 2FA base; UX/TOTP flow ongoing)
|
32. Security - `PARTIAL` (sessions + revoke + 2FA base; revoke-all now invalidates active access tokens, UX/TOTP flow ongoing)
|
||||||
33. Realtime Events - `DONE` (connect/disconnect/send/receive/typing/read/delivered/online/offline + chat/message updates)
|
33. Realtime Events - `DONE` (connect/disconnect/send/receive/typing/read/delivered/online/offline + chat/message updates)
|
||||||
34. Sync - `PARTIAL` (cross-device via backend state + realtime; offline reconciliation basic)
|
34. Sync - `PARTIAL` (cross-device via backend state + realtime; reconciliation improved for loaded chats/messages)
|
||||||
35. Additional - `PARTIAL` (drafts/link preview partial/autoload media basic)
|
35. Additional - `PARTIAL` (drafts/link preview partial/autoload media basic)
|
||||||
|
|
||||||
## Current Focus to reach ~80%
|
## Current Focus to reach ~80%
|
||||||
|
|||||||
@@ -132,6 +132,19 @@ export function MessageList() {
|
|||||||
() => selectedMessages.length > 0 && selectedMessages.every((m) => canDeleteForEveryone(m, activeChat, me?.id)),
|
() => selectedMessages.length > 0 && selectedMessages.every((m) => canDeleteForEveryone(m, activeChat, me?.id)),
|
||||||
[selectedMessages, activeChat, me?.id]
|
[selectedMessages, activeChat, me?.id]
|
||||||
);
|
);
|
||||||
|
const canDeleteCurrentContextMessage = useMemo(() => {
|
||||||
|
if (!ctx) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const message = messagesMap.get(ctx.messageId);
|
||||||
|
if (!message) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (channelOnlyDeleteForAll) {
|
||||||
|
return canDeleteForEveryone(message, activeChat, me?.id);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}, [ctx, messagesMap, channelOnlyDeleteForAll, activeChat, me?.id]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const onKeyDown = (event: KeyboardEvent) => {
|
const onKeyDown = (event: KeyboardEvent) => {
|
||||||
@@ -684,16 +697,18 @@ export function MessageList() {
|
|||||||
>
|
>
|
||||||
Select
|
Select
|
||||||
</button>
|
</button>
|
||||||
<button
|
{canDeleteCurrentContextMessage ? (
|
||||||
className="block w-full rounded px-2 py-1.5 text-left text-sm text-red-300 hover:bg-slate-800"
|
<button
|
||||||
onClick={() => {
|
className="block w-full rounded px-2 py-1.5 text-left text-sm text-red-300 hover:bg-slate-800"
|
||||||
setDeleteMessageId(ctx.messageId);
|
onClick={() => {
|
||||||
setDeleteError(null);
|
setDeleteMessageId(ctx.messageId);
|
||||||
setCtx(null);
|
setDeleteError(null);
|
||||||
}}
|
setCtx(null);
|
||||||
>
|
}}
|
||||||
Delete
|
>
|
||||||
</button>
|
Delete
|
||||||
|
</button>
|
||||||
|
) : null}
|
||||||
<button className="block w-full rounded px-2 py-1.5 text-left text-sm hover:bg-slate-800" onClick={() => void handlePin(ctx.messageId)}>
|
<button className="block w-full rounded px-2 py-1.5 text-left text-sm hover:bg-slate-800" onClick={() => void handlePin(ctx.messageId)}>
|
||||||
Pin / Unpin
|
Pin / Unpin
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user