feat: add long-press contextual actions on post cards

Long press any post card to open a context menu with state-aware actions:
- Copy text (all states)
- ERROR: Retry now, Edit & retry, View error message
- QUEUE: Edit, Reschedule (native DateTimePicker → PUT /posts/:id)
- PUBLISHED: Repost
- DRAFT: Edit & schedule

Compose screen now accepts prefillContent/prefillIntegrationIds router
params to pre-fill content and channel selection when editing or reposting.
Adds expo-clipboard for clipboard support.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-17 21:52:07 +02:00
parent 803f147fbb
commit 3191691fff
7 changed files with 190 additions and 10 deletions
+13 -1
View File
@@ -5,7 +5,8 @@ import * as Haptics from "expo-haptics";
import { Image } from "expo-image";
import * as ImagePicker from "expo-image-picker";
import { fetch as expoFetch } from "expo/fetch";
import React, { useState } from "react";
import { useLocalSearchParams } from "expo-router";
import React, { useEffect, useState } from "react";
import {
ActivityIndicator,
Alert,
@@ -29,6 +30,10 @@ export default function ComposeScreen() {
const insets = useSafeAreaInsets();
const { client, isConfigured, apiKey, baseUrl } = usePostiz();
const queryClient = useQueryClient();
const { prefillContent, prefillIntegrationIds } = useLocalSearchParams<{
prefillContent?: string;
prefillIntegrationIds?: string;
}>();
const [content, setContent] = useState("");
const [selectedChannels, setSelectedChannels] = useState<string[]>([]);
const [postNow, setPostNow] = useState(false);
@@ -41,6 +46,13 @@ export default function ComposeScreen() {
const [uploading, setUploading] = useState(false);
const [submitting, setSubmitting] = useState(false);
useEffect(() => {
if (prefillContent) setContent(String(prefillContent));
if (prefillIntegrationIds) {
setSelectedChannels(String(prefillIntegrationIds).split(",").filter(Boolean));
}
}, [prefillContent, prefillIntegrationIds]);
const { data: integrations, isLoading: loadingIntegrations } =
useQuery<PostizIntegration[]>({
queryKey: ["integrations", !!client],