fixed shared to viewing in settings and added workspace navigation in mobile view

This commit is contained in:
2026-02-11 13:21:23 -06:00
parent 25403ecaf0
commit 9761c8c5fc
3 changed files with 105 additions and 39 deletions
+53 -11
View File
@@ -179,32 +179,39 @@ export const SettingsView: Component = () => {
</div>
{/* Active share rules */}
{/* Active share rules - Custom */}
<div class="space-y-2">
<h4 class="text-xs font-bold uppercase tracking-wider text-muted-foreground pb-1">Custom Rules</h4>
{/* Active share rules - Outgoing */}
<div class="space-y-3">
<h4 class="text-[10px] font-black uppercase tracking-widest text-muted-foreground pb-1 flex items-center gap-2">
<div class="w-1 h-1 rounded-full bg-primary" />
Sharing With Others
</h4>
<For each={store.shareRules.filter(r => {
const isSystem = r.type === 'tag' && store.tagDefinitions.find(t => t.name === r.tagName)?.isUser;
return !isSystem;
const isOwner = r.ownerId === pb.authStore.model?.id;
return !isSystem && isOwner;
})} fallback={
<div class="text-center py-4 text-muted-foreground text-xs italic border border-dashed border-border rounded-xl">
No custom share rules.
<div class="text-center py-4 text-muted-foreground text-[10px] uppercase tracking-widest italic border border-dashed border-border/40 rounded-xl bg-muted/5">
You aren't sharing with anyone yet.
</div>
}>
{(rule) => (
<div class="flex items-center justify-between p-3 rounded-xl bg-muted/20 border border-border/40 gap-3">
<div class="flex items-center justify-between p-3 rounded-xl bg-muted/20 border border-border/40 gap-3 group/rule hover:bg-muted/30 transition-all">
<div class="flex items-center gap-3 min-w-0 flex-1">
{rule.type === 'all' ? <Users size={14} class="text-primary shrink-0" /> : <Tag size={14} class="text-primary shrink-0" />}
<div class="w-8 h-8 rounded-lg bg-primary/10 flex items-center justify-center text-primary shrink-0 transition-transform group-hover/rule:scale-110">
{rule.type === 'all' ? <Users size={14} /> : <Tag size={14} />}
</div>
<div class="min-w-0">
<p class="text-sm font-medium truncate">{getUserName(rule.targetUserId)}</p>
<p class="text-[10px] text-muted-foreground uppercase tracking-wider">
<p class="text-xs font-bold truncate">To: {getUserName(rule.targetUserId)}</p>
<p class="text-[9px] text-muted-foreground uppercase font-black tracking-widest opacity-60 flex items-center gap-1">
{rule.type === 'all' ? 'All Tasks' : `Tag: ${rule.tagName}`}
<ArrowLeftRight size={8} class="rotate-45" />
</p>
</div>
</div>
<Button
variant="ghost"
size="icon"
class="h-8 w-8 hover:bg-destructive/10 hover:text-destructive"
class="h-8 w-8 hover:bg-destructive/10 hover:text-destructive rounded-lg transition-all opacity-0 group-hover/rule:opacity-100"
onClick={() => removeShareRule(rule.id)}
>
<Trash2 size={14} />
@@ -214,6 +221,41 @@ export const SettingsView: Component = () => {
</For>
</div>
{/* Active share rules - Incoming */}
<div class="space-y-3 pt-4 border-t border-border/20">
<h4 class="text-[10px] font-black uppercase tracking-widest text-muted-foreground pb-1 flex items-center gap-2">
<div class="w-1 h-1 rounded-full bg-indigo-500" />
Shared With You
</h4>
<For each={store.shareRules.filter(r => {
const isSystem = r.type === 'tag' && store.tagDefinitions.find(t => t.name === r.tagName)?.isUser;
const isTarget = r.targetUserId === pb.authStore.model?.id;
return !isSystem && isTarget;
})} fallback={
<div class="text-center py-4 text-muted-foreground text-[10px] uppercase tracking-widest italic border border-dashed border-border/40 rounded-xl bg-muted/5">
No one has shared with you yet.
</div>
}>
{(rule) => (
<div class="flex items-center justify-between p-3 rounded-xl bg-muted/20 border border-border/40 gap-3 group/rule hover:bg-muted/30 transition-all opacity-80">
<div class="flex items-center gap-3 min-w-0 flex-1">
<div class="w-8 h-8 rounded-lg bg-indigo-500/10 flex items-center justify-center text-indigo-500 shrink-0">
{rule.type === 'all' ? <Users size={14} /> : <Tag size={14} />}
</div>
<div class="min-w-0">
<p class="text-xs font-bold truncate">From: {getUserName(rule.ownerId)}</p>
<p class="text-[9px] text-muted-foreground uppercase font-black tracking-widest opacity-60 flex items-center gap-1">
{rule.type === 'all' ? 'All Tasks' : `Tag: ${rule.tagName}`}
<ArrowLeftRight size={8} class="-rotate-45" />
</p>
</div>
</div>
{/* No delete button for incoming rules unless we add leave logic later */}
</div>
)}
</For>
</div>
{/* Active share rules - System */}
<details class="group/details">
<summary class="flex items-center gap-2 text-xs font-bold uppercase tracking-wider text-muted-foreground cursor-pointer hover:text-foreground transition-colors py-2 select-none">