fix: eigene Story als Ring "Deine Story" in der Story-Leiste (Web + App)
Die Leiste zeigte nur Storys gefolgter Tiere — das eigene aktive Tier war nie enthalten, man konnte die eigene Story nach dem Posten nicht ansehen. Neuer Ring direkt nach der "+"-Kachel, solange stories.hasActiveStory für das aktive Tier true ist. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1a24ebae89
commit
204d5f6831
7 files changed
+79
-17
No files matched your search
+2
-1
@@ -586,7 +586,8 @@
|
||||
"StoryTray": {
|
||||
"storiesAriaLabel": "Storys",
|
||||
"addStory": "Story hinzufügen",
|
||||
"newStoryTitle": "Neue Story"
|
||||
"newStoryTitle": "Neue Story",
|
||||
"yourStory": "Deine Story"
|
||||
},
|
||||
"RepostCard": {
|
||||
"pawedBackBy": "Paw-Back von"
|
||||
|
||||
+2
-1
@@ -586,7 +586,8 @@
|
||||
"StoryTray": {
|
||||
"storiesAriaLabel": "Stories",
|
||||
"addStory": "Add story",
|
||||
"newStoryTitle": "New Story"
|
||||
"newStoryTitle": "New Story",
|
||||
"yourStory": "Your story"
|
||||
},
|
||||
"RepostCard": {
|
||||
"pawedBackBy": "Pawed-back by"
|
||||
|
||||
@@ -139,6 +139,9 @@ Neu 7:
|
||||
**Stolperstein beim Publish:** Das lokale (gitignorete) `mobile/android/`-Verzeichnis vom Device-Test der letzten Session ließ `eas update` das Projekt fälschlich als "Bare Workflow" erkennen (`CommandError: runtime version policies are not supported` statt der konfigurierten `"policy": "appVersion"`) — Fix war, `android/` kurz umzubenennen/wegzuschieben, Update zu publishen, danach zurückzubenennen. Für künftige OTA-Publishes nach einem lokalen `expo run:android`-Test: dasselbe Problem erwarten.
|
||||
- [x] Im Pet-Profil ist der Erste Post nicht Klickbar da er in die Gesten-Steuerung rein ragt.
|
||||
→ Ursache: Android läuft edge-to-edge, und die Stack-Screens (ohne Tab-Leiste darunter) hatten unten keinen Safe-Area-Abstand — der letzte Inhalt lag unter der Gesten-Leiste. Fix: neuer Hook `src/hooks/useBottomSafePadding.ts` (paddingBottom = 16 + insets.bottom), eingebaut in Tierprofil, Follower, Folgt, Gesundheit, Meilensteine, Profil bearbeiten, Einstellungen, Suche, Nachrichten-Liste und Konto löschen. Commit `de237f1`, per OTA für Android veröffentlicht (Update-Group `4dc6f797`), noch nicht am Gerät bestätigt. Gilt automatisch auch für iOS (Home-Indicator).
|
||||
- [x] Nutzer-Feedback: Nach dem Posten einer Story erscheint man selbst nicht als Ring — man kann die eigene Story nicht ansehen.
|
||||
→ Ursache (Web **und** App gleich): Die Story-Leiste zeigt nur die „+“-Kachel und Storys gefolgter Tiere (`follows.getPetsWithActiveStories`); das eigene aktive Tier ist darin nie enthalten. Fix: zusätzlicher Ring „Deine Story“ direkt nach der „+“-Kachel, solange das aktive Tier eine aktive Story hat (`stories.hasActiveStory`, wird nach dem Posten schon invalidiert). Web: `src/components/stories/StoryTray.tsx` (öffnet den StoryViewer — dort sieht der Owner auch die Zuschauerliste); App: `src/components/StoryTray.tsx`. Typecheck/Tests/Build grün; die 2 Lint-Fehler „Cannot access refs during render“ in der Web-StoryTray bestanden schon vorher (horizontales Scrollen).
|
||||
**Story-Kommentare:** Backend (`stories.addComment/listComments/deleteComment`, `toggleReaction`, `getViewers`) und Web-UI (`StoryCommentsOverlay`) existieren bereits — nur der App-Viewer (`app/(app)/story-viewer.tsx`) hat Kommentare, Reaktionen und Zuschauerliste beim Portieren bewusst ausgelassen. Offen als eigener Punkt.
|
||||
-
|
||||
|
||||
|
||||
|
||||
@@ -16,8 +16,9 @@ const RING_BOX = getPawRingBox(AVATAR_SIZE);
|
||||
|
||||
/**
|
||||
* Port of web's src/components/stories/StoryTray.tsx: an "add story" tile
|
||||
* for the active pet, then followed pets with an active story (each in a
|
||||
* PawRing). No viewer list, reactions, or comments on stories yet (Gitea
|
||||
* for the active pet, then the active pet's own story while it has one
|
||||
* ("Deine Story" — the followed-pets query never includes the viewer's own
|
||||
* pet), then followed pets with an active story (each in a PawRing). No viewer list, reactions, or comments on stories yet (Gitea
|
||||
* #29 on web) — that's a fast-follow, matching how earlier phases trimmed
|
||||
* AI-disclosure/mentions from ported forms. Photo stories only, no video
|
||||
* story upload/playback (mirrors mobile's post-creation scope decision).
|
||||
@@ -26,10 +27,22 @@ export function StoryTray() {
|
||||
const { t } = useTranslation();
|
||||
const trpc = useTRPC();
|
||||
const router = useRouter();
|
||||
const { activePetId } = useActivePet();
|
||||
const { activePetId, pets } = useActivePet();
|
||||
const { colors } = useTheme();
|
||||
const styles = useMemo(() => makeStyles(colors), [colors]);
|
||||
|
||||
const { data: ownStory } = useQuery({
|
||||
...trpc.stories.hasActiveStory.queryOptions({ petId: activePetId ?? "" }),
|
||||
enabled: !!activePetId,
|
||||
});
|
||||
const activePet = pets.find((pet) => pet.id === activePetId) ?? null;
|
||||
|
||||
const openViewer = (pet: { id: string; name: string; avatarKey?: string | null }) =>
|
||||
router.push({
|
||||
pathname: "/story-viewer",
|
||||
params: { petId: pet.id, petName: pet.name, petAvatarKey: pet.avatarKey ?? "" },
|
||||
});
|
||||
|
||||
const { data: followedWithStories = [] } = useQuery({
|
||||
...trpc.follows.getPetsWithActiveStories.queryOptions({ followerPetId: activePetId ?? "" }),
|
||||
enabled: !!activePetId,
|
||||
@@ -48,17 +61,19 @@ export function StoryTray() {
|
||||
</Text>
|
||||
</Pressable>
|
||||
|
||||
{ownStory?.hasStory && activePet && (
|
||||
<Pressable style={styles.item} onPress={() => openViewer(activePet)}>
|
||||
<PawRing petId={activePet.id} size={AVATAR_SIZE}>
|
||||
<PetAvatar name={activePet.name} avatarKey={activePet.avatarKey} size="lg" />
|
||||
</PawRing>
|
||||
<Text style={styles.label} numberOfLines={1}>
|
||||
{t("feed.yourStory")}
|
||||
</Text>
|
||||
</Pressable>
|
||||
)}
|
||||
|
||||
{followedWithStories.map((pet) => (
|
||||
<Pressable
|
||||
key={pet.id}
|
||||
style={styles.item}
|
||||
onPress={() =>
|
||||
router.push({
|
||||
pathname: "/story-viewer",
|
||||
params: { petId: pet.id, petName: pet.name, petAvatarKey: pet.avatarKey ?? "" },
|
||||
})
|
||||
}
|
||||
>
|
||||
<Pressable key={pet.id} style={styles.item} onPress={() => openViewer(pet)}>
|
||||
<PawRing petId={pet.id} size={AVATAR_SIZE}>
|
||||
<PetAvatar name={pet.name} avatarKey={pet.avatarKey} size="lg" />
|
||||
</PawRing>
|
||||
|
||||
@@ -48,7 +48,8 @@
|
||||
"feed": {
|
||||
"empty": "Noch keine Beiträge im Feed.",
|
||||
"storyLabel": "Story",
|
||||
"trendingBadge": "Trending"
|
||||
"trendingBadge": "Trending",
|
||||
"yourStory": "Deine Story"
|
||||
},
|
||||
"explore": {
|
||||
"allTab": "Alle",
|
||||
|
||||
@@ -48,7 +48,8 @@
|
||||
"feed": {
|
||||
"empty": "No posts in your feed yet.",
|
||||
"storyLabel": "Story",
|
||||
"trendingBadge": "Trending"
|
||||
"trendingBadge": "Trending",
|
||||
"yourStory": "Your story"
|
||||
},
|
||||
"explore": {
|
||||
"allTab": "All",
|
||||
|
||||
@@ -27,6 +27,10 @@ const TRAY_ITEM_SIZE = TRAY_AVATAR_SIZE + RING_PAD * 2; // total height of a Paw
|
||||
* StoryTray — horizontal scroll row at the top of the feed.
|
||||
*
|
||||
* First item: "Add story" button (orange) → opens StoryForm dialog.
|
||||
* Second item (only while it has an active story): the active pet's own
|
||||
* story — the followed-pets query below never includes the viewer's own pet,
|
||||
* so without this an owner could not see what they just posted (and the
|
||||
* owner-only viewer list in StoryViewer was unreachable from the tray).
|
||||
* Remaining items: pets followed by the active pet that have active stories,
|
||||
* each wrapped in PawRing. Tapping a pet opens the StoryViewer.
|
||||
*/
|
||||
@@ -44,6 +48,16 @@ export function StoryTray() {
|
||||
} | null>(null);
|
||||
|
||||
// Fetch pets followed by the active pet that have active stories
|
||||
// Eigene Story: gleiche Query-Form wie StoryForm's Invalidierung ({ petId }),
|
||||
// damit der Ring direkt nach dem Posten erscheint.
|
||||
const { data: ownStory } = useQuery({
|
||||
...trpc.stories.hasActiveStory.queryOptions({ petId: activePetId ?? "" }),
|
||||
enabled: !!activePetId,
|
||||
});
|
||||
const { data: myPets = [] } = useQuery({ ...trpc.pets.list.queryOptions(), enabled: !!activePetId });
|
||||
const activePet = myPets.find((pet) => pet.id === activePetId) ?? null;
|
||||
const showOwnStory = !!ownStory?.hasStory && !!activePet;
|
||||
|
||||
const { data: followedWithStories = [] } = useQuery({
|
||||
...trpc.follows.getPetsWithActiveStories.queryOptions({
|
||||
followerPetId: activePetId ?? "",
|
||||
@@ -81,6 +95,32 @@ export function StoryTray() {
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* Own active story */}
|
||||
{showOwnStory && activePet && (
|
||||
<div className="flex flex-col items-center gap-1 shrink-0" role="listitem">
|
||||
<PawRing
|
||||
petId={activePet.id}
|
||||
size={TRAY_AVATAR_SIZE}
|
||||
onPress={() =>
|
||||
setViewingPet({ id: activePet.id, name: activePet.name, avatarKey: activePet.avatarKey ?? null })
|
||||
}
|
||||
>
|
||||
<Avatar
|
||||
className="border-2 border-background"
|
||||
style={{ width: TRAY_AVATAR_SIZE, height: TRAY_AVATAR_SIZE }}
|
||||
>
|
||||
{activePet.avatarKey && (
|
||||
<AvatarImage src={getAvatarUrl(activePet.avatarKey) ?? ""} alt={activePet.name} />
|
||||
)}
|
||||
<AvatarFallback className="text-sm bg-muted">
|
||||
{activePet.name[0]?.toUpperCase() ?? "?"}
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
</PawRing>
|
||||
<span className="text-xs text-foreground truncate max-w-[72px]">{t("yourStory")}</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Followed pets with active stories */}
|
||||
{followedWithStories.map((pet) => (
|
||||
<div
|
||||
|
||||
Reference in new issue
Block a user