web: refresh full chat info panel after moderation actions
Some checks are pending
CI / test (push) Has started running

This commit is contained in:
2026-03-08 22:40:56 +03:00
parent f9c8ba5c52
commit 16f3d91c3b
2 changed files with 9 additions and 16 deletions

View File

@@ -31,7 +31,7 @@ Legend:
22. Text Formatting - `PARTIAL` (bold/italic/underline/spoiler/mono/links + strikethrough + quote/code block; toolbar still evolving) 22. Text Formatting - `PARTIAL` (bold/italic/underline/spoiler/mono/links + strikethrough + quote/code block; toolbar still evolving)
23. Groups - `PARTIAL` (create/add/remove/invite link; join-by-invite and invite permissions covered by integration tests; members API now returns profile fields (`username/name/avatar_url`) and web Chat Info consumes them to avoid extra per-member profile requests; add-member search also shows avatars; advanced moderation still partial) 23. Groups - `PARTIAL` (create/add/remove/invite link; join-by-invite and invite permissions covered by integration tests; members API now returns profile fields (`username/name/avatar_url`) and web Chat Info consumes them to avoid extra per-member profile requests; add-member search also shows avatars; advanced moderation still partial)
24. Roles - `DONE` (owner/admin/member) 24. Roles - `DONE` (owner/admin/member)
25. Admin Rights - `PARTIAL` (delete/pin/edit info + explicit ban APIs for groups/channels including ban list endpoint; web Chat Info now shows searchable `Banned users` with both inline and right-click `Unban` actions for owner/admin, member search, avatars in moderation lists, invite-link copy/regenerate actions, ban metadata (`who banned/when`), explicit member action button for touch/trackpad UX, `@username`-friendly moderation filters, and resilient profile hydration (`allSettled`) for partially missing users; add-member and banned-filters now show explicit empty-state hints; integration tests cover channel member read-only, channel admin full-delete, channel message delete-for-all permissions, group profile edit permissions, owner-only role management rules, and admin-visible/member-forbidden ban-list access; remaining UX moderation tools limited) 25. Admin Rights - `PARTIAL` (delete/pin/edit info + explicit ban APIs for groups/channels including ban list endpoint; web Chat Info now shows searchable `Banned users` with both inline and right-click `Unban` actions for owner/admin, member search, avatars in moderation lists, invite-link copy/regenerate actions, ban metadata (`who banned/when`), explicit member action button for touch/trackpad UX, `@username`-friendly moderation filters, and resilient profile hydration (`allSettled`) for partially missing users; add-member and banned-filters now show explicit empty-state hints; moderation actions (`add/remove/ban/unban/promote/demote/transfer owner`) now force full panel refresh to keep members/bans/counters in sync without manual reopen; integration tests cover channel member read-only, channel admin full-delete, channel message delete-for-all permissions, group profile edit permissions, owner-only role management rules, and admin-visible/member-forbidden ban-list access; remaining UX moderation tools limited)
26. Channels - `PARTIAL` (create/post/edit/delete/subscribe/unsubscribe; integration tests now also cover invite-link permissions (member forbidden, admin allowed); web Chat Info now differentiates destructive actions by role for both groups/channels (`Delete ... for all` for owner/admin, `Leave` for members) and blocks invalid owner-leave action when members remain; app auto-join by invite token is now single-shot with toast errors (no retry spam on invalid/expired links); remaining UX edge-cases still polishing) 26. Channels - `PARTIAL` (create/post/edit/delete/subscribe/unsubscribe; integration tests now also cover invite-link permissions (member forbidden, admin allowed); web Chat Info now differentiates destructive actions by role for both groups/channels (`Delete ... for all` for owner/admin, `Leave` for members) and blocks invalid owner-leave action when members remain; app auto-join by invite token is now single-shot with toast errors (no retry spam on invalid/expired links); remaining UX edge-cases still polishing)
27. Channel Types - `DONE` (public/private) 27. Channel Types - `DONE` (public/private)
28. Notifications - `PARTIAL` (browser notifications + mute/settings; chat mute is propagated in chat list payload, honored by web realtime notifications with mention override, and mute toggle now syncs instantly in chat store; backend now emits `chat_updated` after notification mute/unmute for cross-tab consistency; no mobile push infra) 28. Notifications - `PARTIAL` (browser notifications + mute/settings; chat mute is propagated in chat list payload, honored by web realtime notifications with mention override, and mute toggle now syncs instantly in chat store; backend now emits `chat_updated` after notification mute/unmute for cross-tab consistency; no mobile push infra)

View File

@@ -691,7 +691,7 @@ export function ChatInfoPanel({ chatId, open, onClose }: Props) {
await addChatMember(chatId, user.id); await addChatMember(chatId, user.id);
setSearchQuery(""); setSearchQuery("");
setSearchResults([]); setSearchResults([]);
await refreshMembers(chatId); await refreshPanelData(chatId, false);
} catch { } catch {
setError("Failed to add member"); setError("Failed to add member");
} }
@@ -769,8 +769,7 @@ export function ChatInfoPanel({ chatId, open, onClose }: Props) {
event.stopPropagation(); event.stopPropagation();
try { try {
await unbanChatMember(chatId, ban.user_id); await unbanChatMember(chatId, ban.user_id);
await refreshBans(chatId, false); await refreshPanelData(chatId, false);
await refreshMembers(chatId);
showToast("User unbanned"); showToast("User unbanned");
} catch { } catch {
setError("Failed to unban user"); setError("Failed to unban user");
@@ -1106,8 +1105,7 @@ export function ChatInfoPanel({ chatId, open, onClose }: Props) {
onClick={async () => { onClick={async () => {
try { try {
await updateChatMemberRole(chatId, memberCtx.member.user_id, "admin"); await updateChatMemberRole(chatId, memberCtx.member.user_id, "admin");
await refreshMembers(chatId); await refreshPanelData(chatId, false);
await refreshBans(chatId);
} catch { } catch {
setError("Failed to update role"); setError("Failed to update role");
} finally { } finally {
@@ -1125,8 +1123,7 @@ export function ChatInfoPanel({ chatId, open, onClose }: Props) {
onClick={async () => { onClick={async () => {
try { try {
await updateChatMemberRole(chatId, memberCtx.member.user_id, "member"); await updateChatMemberRole(chatId, memberCtx.member.user_id, "member");
await refreshMembers(chatId); await refreshPanelData(chatId, false);
await refreshBans(chatId);
} catch { } catch {
setError("Failed to update role"); setError("Failed to update role");
} finally { } finally {
@@ -1144,8 +1141,7 @@ export function ChatInfoPanel({ chatId, open, onClose }: Props) {
onClick={async () => { onClick={async () => {
try { try {
await updateChatMemberRole(chatId, memberCtx.member.user_id, "owner"); await updateChatMemberRole(chatId, memberCtx.member.user_id, "owner");
await refreshMembers(chatId); await refreshPanelData(chatId, false);
await refreshBans(chatId);
} catch { } catch {
setError("Failed to transfer ownership"); setError("Failed to transfer ownership");
} finally { } finally {
@@ -1163,8 +1159,7 @@ export function ChatInfoPanel({ chatId, open, onClose }: Props) {
onClick={async () => { onClick={async () => {
try { try {
await banChatMember(chatId, memberCtx.member.user_id); await banChatMember(chatId, memberCtx.member.user_id);
await refreshMembers(chatId); await refreshPanelData(chatId, false);
await refreshBans(chatId);
} catch { } catch {
setError("Failed to ban member"); setError("Failed to ban member");
} finally { } finally {
@@ -1182,8 +1177,7 @@ export function ChatInfoPanel({ chatId, open, onClose }: Props) {
onClick={async () => { onClick={async () => {
try { try {
await removeChatMember(chatId, memberCtx.member.user_id); await removeChatMember(chatId, memberCtx.member.user_id);
await refreshMembers(chatId); await refreshPanelData(chatId, false);
await refreshBans(chatId);
} catch { } catch {
setError("Failed to remove member"); setError("Failed to remove member");
} finally { } finally {
@@ -1215,8 +1209,7 @@ export function ChatInfoPanel({ chatId, open, onClose }: Props) {
onClick={async () => { onClick={async () => {
try { try {
await unbanChatMember(chatId, banCtx.ban.user_id); await unbanChatMember(chatId, banCtx.ban.user_id);
await refreshBans(chatId, false); await refreshPanelData(chatId, false);
await refreshMembers(chatId);
showToast("User unbanned"); showToast("User unbanned");
} catch { } catch {
setError("Failed to unban user"); setError("Failed to unban user");