🐛 row-level archive and permanent delete actions for messages
Browse files at this commit68d09e3a32090e2686c42bd29da142f948060836Parent: c41c4bc- fix
- 🐛 row-level archive and permanent delete actions for messages
2 changed files +29 -9
src/components/messages/gmail-mail-row.tsxmodified+24 -9
| @@ -14,6 +14,7 @@ interface GmailMailRowProps { | |||
| 14 | onSelect: () => void; | 14 | onSelect: () => void; |
| 15 | onArchive?: () => void; | 15 | onArchive?: () => void; |
| 16 | onTrash?: () => void; | 16 | onTrash?: () => void; |
| 17 | + onDeleteForever?: () => void; | ||
| 17 | onToggleRead?: () => void; | 18 | onToggleRead?: () => void; |
| 18 | } | 19 | } |
| 19 | 20 | ||
| @@ -88,15 +89,15 @@ export function GmailMailRow(props: GmailMailRowProps) { | |||
| 88 | </Badge> | 89 | </Badge> |
| 89 | </Show> | 90 | </Show> |
| 90 | 91 | ||
| 91 | - {/* Fixed-width & Fixed-height Right Action Area */} | 92 | + {/* Right Action & Date Area */} |
| 92 | - <div class="shrink-0 w-24 h-full flex items-center justify-end"> | 93 | + <div class="shrink-0 flex items-center gap-2 justify-end min-w-fit"> |
| 93 | - {/* Time / Date (Default View) */} | 94 | + {/* Time / Date */} |
| 94 | - <div class="font-mono text-[11px] text-muted-foreground text-right group-hover:hidden"> | 95 | + <span class="font-mono text-[11px] text-muted-foreground/80 shrink-0"> |
| 95 | {formattedTime(props.message.sent_at)} | 96 | {formattedTime(props.message.sent_at)} |
| 96 | - </div> | 97 | + </span> |
| 97 | 98 | ||
| 98 | - {/* Gmail Hover Quick Action Bar (Hover View - Fixed h-6 buttons to fit h-10 row cleanly) */} | 99 | + {/* Quick Actions (Always visible with opacity on mobile, group-hover visible on desktop) */} |
| 99 | - <div class="hidden items-center justify-end gap-1 group-hover:flex"> | 100 | + <div class="flex items-center justify-end gap-1 opacity-90 sm:opacity-0 group-hover:opacity-100 transition-opacity"> |
| 100 | <Show when={props.onArchive}> | 101 | <Show when={props.onArchive}> |
| 101 | <button | 102 | <button |
| 102 | type="button" | 103 | type="button" |
| @@ -114,7 +115,7 @@ export function GmailMailRow(props: GmailMailRowProps) { | |||
| 114 | <Show when={props.onTrash}> | 115 | <Show when={props.onTrash}> |
| 115 | <button | 116 | <button |
| 116 | type="button" | 117 | type="button" |
| 117 | - class="flex h-6 w-6 items-center justify-center rounded-lg text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors" | 118 | + class="flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors" |
| 118 | title={props.folder === "trash" ? "Çöp Kutusundan Çıkar" : t("messages.moveToTrash")} | 119 | title={props.folder === "trash" ? "Çöp Kutusundan Çıkar" : t("messages.moveToTrash")} |
| 119 | onClick={(e) => { | 120 | onClick={(e) => { |
| 120 | e.stopPropagation(); | 121 | e.stopPropagation(); |
| @@ -125,10 +126,24 @@ export function GmailMailRow(props: GmailMailRowProps) { | |||
| 125 | </button> | 126 | </button> |
| 126 | </Show> | 127 | </Show> |
| 127 | 128 | ||
| 129 | + <Show when={props.onDeleteForever}> | ||
| 130 | + <button | ||
| 131 | + type="button" | ||
| 132 | + class="flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors" | ||
| 133 | + title={t("messages.deleteForever")} | ||
| 134 | + onClick={(e) => { | ||
| 135 | + e.stopPropagation(); | ||
| 136 | + props.onDeleteForever?.(); | ||
| 137 | + }} | ||
| 138 | + > | ||
| 139 | + <IconTrash class="h-3.5 w-3.5 text-destructive" /> | ||
| 140 | + </button> | ||
| 141 | + </Show> | ||
| 142 | + | ||
| 128 | <Show when={props.onToggleRead}> | 143 | <Show when={props.onToggleRead}> |
| 129 | <button | 144 | <button |
| 130 | type="button" | 145 | type="button" |
| 131 | - class="flex h-6 w-6 items-center justify-center rounded-lg text-muted-foreground hover:bg-accent hover:text-foreground transition-colors" | 146 | + class="flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors" |
| 132 | title={unread() ? "Okundu olarak işaretle" : "Okunmadı olarak işaretle"} | 147 | title={unread() ? "Okundu olarak işaretle" : "Okunmadı olarak işaretle"} |
| 133 | onClick={(e) => { | 148 | onClick={(e) => { |
| 134 | e.stopPropagation(); | 149 | e.stopPropagation(); |
src/pages/messages-page.tsxmodified+5 -0
| @@ -381,6 +381,11 @@ export default function MessagesPage() { | |||
| 381 | ? () => handleAction(message, { folder: restoreFolder(message) }) | 381 | ? () => handleAction(message, { folder: restoreFolder(message) }) |
| 382 | : () => handleAction(message, { folder: "trash" }) | 382 | : () => handleAction(message, { folder: "trash" }) |
| 383 | } | 383 | } |
| 384 | + onDeleteForever={ | ||
| 385 | + folder() === "trash" | ||
| 386 | + ? () => handleAction(message, { delete: true }) | ||
| 387 | + : undefined | ||
| 388 | + } | ||
| 384 | onToggleRead={ | 389 | onToggleRead={ |
| 385 | !isOwnSentMessage(message) | 390 | !isOwnSentMessage(message) |
| 386 | ? () => handleAction(message, { read: !message.read }) | 391 | ? () => handleAction(message, { read: !message.read }) |