mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 19:01:08 +02:00
feat(feedback): "Idee teilen" lebt jetzt im PillNav-Usermenü
Ersetzt den schwebenden "Idee?"-Pill durch einen Eintrag im rechten Usermenü (Profil / Credits / Idee teilen / Logout). Ein Affordance an einer Stelle statt zwei nebeneinander. - PillNavigation: neuer onFeedback-Prop + Lightbulb-Icon. Wenn gesetzt, ersetzt der Eintrag den Legacy-/feedback-Link in accountLinks und taucht zusätzlich oben in den userMenuBarItems (barMode) auf. - UserMenuPanel: AccountLink kennt jetzt onClick? als Alternative zu href? — Action-Chips schließen das Panel direkt nach dem Klick. - (app)/+layout: GlobalFeedbackPill-Mount entfernt, FeedbackQuickModal wird state-gebunden gerendert (moduleContext aus Pfad/?app= abgeleitet wie bisher in der alten Pill). - GlobalFeedbackPill.svelte gelöscht — niemand referenziert sie mehr. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
eaa1d7432b
commit
94d3277e2e
4 changed files with 65 additions and 109 deletions
|
|
@ -52,6 +52,7 @@
|
|||
Heart,
|
||||
House,
|
||||
Key,
|
||||
Lightbulb,
|
||||
List,
|
||||
MagnifyingGlass,
|
||||
Microphone,
|
||||
|
|
@ -135,6 +136,7 @@
|
|||
scale: Scales,
|
||||
robot: Robot,
|
||||
key: Key,
|
||||
lightbulb: Lightbulb,
|
||||
shield: Shield,
|
||||
gift: Gift,
|
||||
'music-notes': MusicNotes,
|
||||
|
|
@ -318,8 +320,13 @@
|
|||
contentSearcher?: ContentSearcher;
|
||||
/** Accessible label for the nav element */
|
||||
ariaLabel?: string;
|
||||
/** Feedback page href (shown in user dropdown). Set to empty string to hide. */
|
||||
/** Feedback page href (shown in user dropdown). Set to empty string to hide.
|
||||
* Ignored when `onFeedback` is provided — the action takes precedence. */
|
||||
feedbackHref?: string;
|
||||
/** Called when the user picks "Idee teilen" in the user menu. When set,
|
||||
* the Feedback chip opens the host's quick-feedback modal instead of
|
||||
* navigating to feedbackHref. */
|
||||
onFeedback?: () => void;
|
||||
/** Themes page href (shown in user dropdown). Set to empty string to hide. */
|
||||
themesHref?: string;
|
||||
/** Spiral page href (shown in user dropdown). Set to empty string to hide. */
|
||||
|
|
@ -391,6 +398,7 @@
|
|||
contentSearcher,
|
||||
ariaLabel,
|
||||
feedbackHref = '/feedback',
|
||||
onFeedback,
|
||||
themesHref,
|
||||
spiralHref,
|
||||
creditsHref,
|
||||
|
|
@ -461,7 +469,14 @@
|
|||
|
||||
// Account links for UserMenuPanel
|
||||
const accountLinks = $derived.by(() => {
|
||||
const links: { id: string; label: string; icon: string; href: string; active?: boolean }[] = [];
|
||||
const links: {
|
||||
id: string;
|
||||
label: string;
|
||||
icon: string;
|
||||
href?: string;
|
||||
onClick?: () => void;
|
||||
active?: boolean;
|
||||
}[] = [];
|
||||
if (userEmail && profileHref) {
|
||||
links.push({
|
||||
id: 'profile',
|
||||
|
|
@ -489,7 +504,14 @@
|
|||
active: currentPath === creditsHref,
|
||||
});
|
||||
}
|
||||
if (userEmail && feedbackHref) {
|
||||
if (userEmail && onFeedback) {
|
||||
links.push({
|
||||
id: 'feedback',
|
||||
label: 'Idee teilen',
|
||||
icon: 'lightbulb',
|
||||
onClick: onFeedback,
|
||||
});
|
||||
} else if (userEmail && feedbackHref) {
|
||||
links.push({
|
||||
id: 'feedback',
|
||||
label: 'Feedback',
|
||||
|
|
@ -533,6 +555,15 @@
|
|||
// we don't duplicate it inside the opened bar.
|
||||
const userMenuBarItems = $derived.by<PillDropdownItem[]>(() => {
|
||||
const out: PillDropdownItem[] = [];
|
||||
if (userEmail && onFeedback) {
|
||||
out.push({
|
||||
id: 'feedback',
|
||||
label: 'Idee teilen',
|
||||
icon: 'lightbulb',
|
||||
onClick: () => onFeedback(),
|
||||
});
|
||||
out.push({ id: 'feedback-divider', label: '', divider: true });
|
||||
}
|
||||
if (onThemeModeChange) {
|
||||
out.push(
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
Gear,
|
||||
Globe,
|
||||
Heart,
|
||||
Lightbulb,
|
||||
Moon,
|
||||
Palette,
|
||||
Question,
|
||||
|
|
@ -36,6 +37,7 @@
|
|||
sun: Sun,
|
||||
palette: Palette,
|
||||
robot: Robot,
|
||||
lightbulb: Lightbulb,
|
||||
logout: SignOut,
|
||||
};
|
||||
|
||||
|
|
@ -43,7 +45,8 @@
|
|||
id: string;
|
||||
label: string;
|
||||
icon: string;
|
||||
href: string;
|
||||
href?: string;
|
||||
onClick?: () => void;
|
||||
active?: boolean;
|
||||
}
|
||||
|
||||
|
|
@ -182,7 +185,14 @@
|
|||
<button
|
||||
class="chip"
|
||||
class:active={link.active}
|
||||
onclick={() => navigateTo(link.href)}
|
||||
onclick={() => {
|
||||
if (link.onClick) {
|
||||
link.onClick();
|
||||
onClose();
|
||||
} else if (link.href) {
|
||||
navigateTo(link.href);
|
||||
}
|
||||
}}
|
||||
title={link.label}
|
||||
>
|
||||
{#if icons[link.icon]}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue