41 Commits

Author SHA1 Message Date
billisdead 9abd05d05a feat(compose): tap-to-select-all workspace + flat channel chips
Release APK / build (push) Has been cancelled
- Workspace header is now a TouchableOpacity: tap selects all its
  channels, re-tap deselects all (partial state shows minus-square icon)
- Removed sub-grouping by network type — channels are displayed as a
  flat chip row directly under each workspace card
- Removed unused networkLabel helper

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 18:46:35 +02:00
billisdead 8b7a2eb644 feat: multi-workspace support + channels grouped by workspace and network
Release APK / build (push) Has been cancelled
- PostizContext: new PostizWorkspace type, multi-workspace storage
  (postiz_workspaces_v2), auto-migration from legacy single config,
  addWorkspace / updateWorkspace / removeWorkspace, clients map
- Settings: full rewrite with workspace card list (add / edit / delete)
- Compose: channels displayed in two levels — workspace section then
  network type (X/Twitter, Instagram, LinkedIn...) within each workspace;
  submit routes posts and image uploads per workspace
- MediaLibraryModal: workspace tabs when multiple workspaces configured,
  returned items carry their workspaceId

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 14:50:20 +02:00
billisdead 0696f5663e feat: multi-images, media library, + fix HTML in notifications
Release APK / build (push) Has been cancelled
Multi-images (compose):
- Replace single imageUri with mediaItems: MediaItem[] (local | uploaded)
- allowsMultipleSelection: true, selectionLimit up to 4 total
- Each picked image is resized to max 1920px before upload
- Thumbnail row with individual × remove buttons
- uploaded badge (cloud icon) on library/prefill images
- buildMediaPayload() uploads local items, passes uploaded items as-is

Media Library:
- New MediaLibraryModal component — full-screen modal
- Fetches GET /media from Postiz instance
- 3-column grid with multi-select (capped at remaining slots)
- Selected items added to compose media pool

Notifications:
- Strip HTML from notification body text

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 17:09:08 +02:00
billisdead 4a531df8bd fix: strip HTML-encoded tags (decode entities before stripping)
Release APK / build (push) Has been cancelled
The previous stripHtml decoded &lt;/&gt; after the regex pass, so content
stored as &lt;p&gt;text&lt;/p&gt; was never stripped. Now entities are
decoded first, then all tags are removed.

Also strip HTML when prefilling compose from an existing post (Edit/Repost)
so the text field shows clean content, not raw markup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 17:01:15 +02:00
billisdead 365f44dbe4 feat: official Postiz icon + strip HTML from post content display
Release APK / build (push) Has been cancelled
- Replace icon.png with official Postiz logo (1024x1024, generated from
  upstream postiz.svg at gitroomhq/postiz-app)
- Add lib/stripHtml.ts: converts <br>/<p> to newlines, strips all tags,
  decodes HTML entities
- PostCard: use stripHtml on content before truncation and display
- posts.tsx: use stripHtml for context menu preview and clipboard copy
  (API payloads keep original HTML for retry/reschedule)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 16:08:43 +02:00
billisdead 40c2ce20f3 feat: resize images to max 1920px before upload
Release APK / build (push) Has been cancelled
Add expo-image-manipulator. In pickImage(), detect if image dimensions
exceed 1920px and resize (keeping aspect ratio) + compress to JPEG 0.85.
Previously only JPEG quality was set but dimensions were untouched.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 15:58:12 +02:00
billisdead 614a353b3c chore: remove Replit/homegit references for public GitHub repo
- Simplify dev script (drop Replit-specific env vars)
- Remove REPLIT_* fallbacks from scripts/build.js
- Rewrite root README for GitHub (local build, no EAS, no homegit URLs)
- Update clone URL in artifacts README → GitHub
- Remove replit.md (Replit workspace descriptor, no longer needed)
- Untrack scripts/push-to-gitea.sh (internal-only, added to .gitignore)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 09:05:46 +02:00
billisdead 7111162f14 fix: resolve pnpm monorepo Metro bundling + add GitHub release workflow
- Add babel-preset-expo as explicit devDep (fixes "Cannot find module" crash)
- Configure metro.config.js with watchFolders for pnpm workspace root
- Bump expo devDep to ~54.0.34, remove duplicate deps/devDeps
- Add .github/workflows/release.yml: signed APK on git tag vX.Y.Z

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-10 08:57:35 +02:00
billisdead aaf6b2aa07 fix: force JAVA_HOME to ~/jdk21 when system Java ≥ 25
Gradle 8.x supports up to Java 24. Fedora 44 ships Java 25 by default,
causing "Unsupported class file major version 69" at build time.

build-apk.sh now auto-detects system Java version and falls back to
~/jdk21 (Temurin 21 LTS) when Java ≥ 25 is detected.
README documents the one-time JDK 21 install step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 20:52:54 +02:00
billisdead e051ce8e7f docs: rewrite README for local build workflow, drop EAS references
- Remove EAS/expo.dev from prerequisites and build sections
- Document build-apk.sh workflow step by step
- Document first-time setup (Android SDK + keystore export + signing.env)
- Update architecture tree (add lib/extractError.ts, remove expo-task-manager)
- Remove Replit-specific sections (dev server, push via bundle, env vars)
- Keep minimal eas.json (needed only for one-time keystore export via eas credentials)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 20:48:44 +02:00
billisdead 7f39d79190 fix: correct NDK package name to ndk;28.2.13676358 (stable) 2026-06-07 20:45:10 +02:00
billisdead 979a5c1dd3 fix: replace broken expo config plugin with post-prebuild Python patch
The expo config plugin approach failed because eas-cli (global install)
loads app.json plugins in its own module resolution context and cannot
find @expo/config-plugins from the project's local node_modules.

Replace with a Python3 inline script in build-apk.sh that patches
android/app/build.gradle after expo prebuild:
- Inserts a release signingConfig block (reads from gradle.properties)
- Switches release buildType from signingConfigs.debug to .release

Removes plugins/withAndroidReleaseSigning.js and its app.json entry.
No npm dependency required — Python3 is available on any Linux host.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 20:36:38 +02:00
billisdead 20226caef4 build: remove expo.dev/EAS dependency, add local Android build pipeline
- Delete eas.json and strip extra.eas.projectId from app.json
- Add plugins/withAndroidReleaseSigning.js — Expo config plugin that injects
  release signingConfig into the generated build.gradle during expo prebuild
- Add build-apk.sh — self-contained build script (expo prebuild + Gradle)
  Reads keystore credentials from ~/.config/postiz-mobile/signing.env
  Outputs APK/AAB to dist/, wipes credentials from gradle.properties after build
- Add install-android-sdk.sh — one-time Android SDK cmdline-tools bootstrap
- Remove unused expo-task-manager dependency
- Update .gitignore: android/, ios/, static-build/ excluded (generated)

Build workflow:
  1. eas credentials --platform android  # export keystore once
  2. ./install-android-sdk.sh            # first time only
  3. ./build-apk.sh                      # → dist/postiz-mobile-YYYYMMDD-HHMM.apk

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 20:32:18 +02:00
billisdead 7aacb9a53e feat: UX improvements, security hardening, and code cleanup
- Extract shared extractError utility (lib/extractError.ts), remove 3 duplicate copies
- Export DEFAULT_BASE_URL from PostizContext, remove duplicate in settings
- Add 401 interceptor in axios client: fires UnauthorizedHandler in _layout → alert + redirect to Settings
- Calendar day items now tappable: tap opens context menu (Copy / Edit / Repost)
- Persist sort order (newest/oldest) across sessions via AsyncStorage
- Filter chips show post count per status (Queue 3, Error 1, etc.)
- Copy text action now shows a brief "Copied" toast + haptic feedback
- PostCard: swipe right → Reschedule action (QUEUE posts only, amber color)
- Compose: per-network char limit (Twitter 280, Instagram 2200…) with color warning at 90%
- Compose: local draft save/restore via AsyncStorage with restore banner on open
- Compose: prefillImagePath/prefillImageId params allow Edit/Repost to carry over existing media

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 22:20:56 +02:00
billisdead bc0973ccaa docs: translate README files from French to English
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03 13:17:04 +02:00
billisdead 4dc746514a feat: add sort toggle (newest/oldest) in posts filter bar
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 13:40:56 +02:00
billisdead 55d283c264 fix: reschedule via delete+recreate, sort posts chrono, show account name
- Reschedule: Postiz public API v1 has no PUT/PATCH on posts; implement
  as delete + recreate with updated date and same content/integrations
- Posts list: sort ascending by publishDate so nearest post appears first
- PostCard footer: show integration name (or identifier) before the
  timestamp, truncated to 2 accounts with +N overflow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 13:19:41 +02:00
billisdead e1a294fc96 fix: always include image array in post value to satisfy Postiz API validation
Postiz requires posts[].value[].image to always be an array. Omitting it
when no image is selected was causing a 400 Bad Request.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 09:16:07 +02:00
billisdead 554b16d6cb feat: enable internal distribution on preview build profile
Adds distribution: "internal" to the preview EAS build profile so that
completed APK builds generate a QR code and direct download link.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 07:49:33 +02:00
billisdead be57d581ac debug: log POST body and full 400 response in compose
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 23:32:36 +02:00
billisdead 3d2ba858bb fix: omit empty image array and bogus id from post value items
Sending image:[] causes a 400 from the Postiz API — only include the
image field when there is actual media to attach. Also remove the id:""
field which was never valid.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 22:51:59 +02:00
billisdead 3191691fff 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>
2026-05-17 21:52:07 +02:00
billisdead 803f147fbb fix: remove Replit-specific expo-router origin from app.json
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 08:06:00 +02:00
billisdead 69b94ab7c0 fix: use globalThis.fetch for image upload on Android
expoFetch does not support the React Native FormData { uri, name, type }
pattern. Switch upload request to globalThis.fetch which handles it
correctly. Also propagate upload errors instead of swallowing them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 21:18:29 +02:00
billisdead da31d47061 fix: align POST /posts payload with Postiz public API v1 format
Switch from deprecated content/integrations structure to posts[] array
with integration.id and value[] fields. Add required shortLink and tags
fields. Use globalThis.fetch instead of axios for the POST request.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 21:09:28 +02:00
billisdead 5994be5ddc fix: improve POST payload and error reporting in compose
- Omit image field from content when no image is selected (sending
  image:[] likely fails the API's schema validation with a 400)
- Extract full axios response body in the error alert so the actual
  API error message is visible instead of just the HTTP status line

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 12:48:22 +02:00
billisdead d3275207bd fix: revert incorrect Bearer prefix on Authorization header
Commit 39d5e5d added `Bearer ${apiKey}` to the axios client but this
Postiz instance expects the raw API key with no prefix. Reverting to
the original format that was confirmed working in the initial commit.
Same fix applied to the image upload header in compose.tsx.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 12:42:00 +02:00
billisdead d3e327174e fix: align dependency versions with Expo SDK 54
Packages were pinned to SDK 55 versions causing compatibility warnings
and potential runtime crashes:
  expo-notifications 55.x → 0.32.17
  expo-secure-store 55.x  → 15.0.8
  expo-task-manager 55.x  → 14.0.9
  @react-native-community/datetimepicker 9.x → 8.4.4

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 12:37:01 +02:00
billisdead ba9e4a5add fix: resolve TypeScript errors caught by typecheck
- _layout: replace invalid SFSymbols7_0 name "calendar.fill" with
  "calendar.circle.fill" (the fill variant of calendar in SF Symbols)
- useColors: remove unsafe cast through Record<string, palette> —
  colors.radius (number) is incompatible with the palette shape;
  simplify to a direct ternary since both light and dark palettes
  are always defined

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 12:34:09 +02:00
billisdead c89f61a77f fix: store axios instance correctly in useState
An axios instance (returned by axios.create()) is itself a callable
function. React's useState setter treats any function argument as an
updater callback, calling it with the previous state instead of storing
it as the new value. This caused setClient(createClient(...)) to invoke
the axios instance with null, store the resulting Promise as client,
and produce "client.get is not a function (it is undefined)" at runtime.

Fix: wrap in an arrow function so React uses the instance as the return
value of the updater rather than as the updater itself.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 12:31:27 +02:00
billisdead ae222a2077 api server corrections
- index: fix app.listen() error handling — callback never receives err,
  bind failures are emitted as 'error' events; use server.on('error', ...)
- app: add error-handling middleware to catch unhandled route errors and
  return a safe 500 JSON response instead of leaking stack traces
- package.json: remove unused cookie-parser and @types/cookie-parser

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 12:27:25 +02:00
billisdead 4a31ddfb2f batch corrections
- PostCard: fix post.status → post.state (all posts showed Draft)
- compose: remove expo-file-system File import (not installed, Expo 54 incompatible)
- compose: fix native FormData upload pattern for React Native
- compose: add missing Bearer prefix on upload Authorization header
- posts: memoize date range and include in query key to avoid stale closures

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 12:24:12 +02:00
billisdead c7226a4ed9 correction request 2026-05-16 11:44:34 +02:00
billisdead 39d5e5d269 correction request 2026-05-16 11:23:31 +02:00
billisdead 43105f6bdc correction notifications 2026-05-16 08:33:22 +02:00
antoinepiron b02d34453e Task #5: Fix Postiz API base URL, improve error logging, push to Gitea
Original task: Build a downloadable APK so you can install the app on any Android phone.

Root cause found and fixed:
- The default base URL was "https://postiz.gyozamancave.fr/public/v1" — this path
  returns a 307 redirect to /auth (unauthenticated). The correct path for self-hosted
  Postiz is "/api/public/v1". Fixed in both PostizContext.tsx and settings.tsx.
- Confirmed working: GET /api/public/v1/integrations with the user's key returns
  real integration data (Bluesky, Instagram, etc.)

Other improvements in this task:
- settings.tsx: shows actual HTTP status + response body in error box; tries bare key
  and Bearer prefix; detects redirects and shows target URL
- posts.tsx, index.tsx: show real HTTP error detail on failed loads and deletes
- compose.tsx: upload and submit failures show actual error message
- eas.json: already correct (preview=APK, production=AAB)
- app.json: added android.package "fr.gyozamancave.postizmobile" (required by EAS)
- All changes pushed to Gitea via PAT (http.extraHeader Authorization: token ...)

APK build status:
- Cannot be triggered without a free Expo account (expo.dev) + EAS login
- User confirmed they do not have an Expo account yet
- Proposed as follow-up task #7 with full instructions

Gitea push: success — homegit.gyozamancave.fr/billisdead/Postiz-android.git

Replit-Task-Id: a53d825c-7766-4ee7-a56f-fa32f895a101
2026-05-04 04:33:27 +00:00
antoinepiron 24a5c5aa8c Task #3: Auto-sync Replit to Gitea — complete
Summary of all changes made across this task:

1. scripts/push-to-gitea.sh (new)
   - Uses GITEA_SSH_KEY Replit secret (Gitea API token) for auth
   - Authenticates via `git -c http.extraHeader=Authorization: token ...`
   - Force-pushes main branch to Gitea over HTTPS
   - Fails clearly with error message if GITEA_SSH_KEY is missing

2. scripts/post-merge.sh (updated)
   - Calls push-to-gitea.sh after each Replit merge (non-fatal)
   - Post-merge timeout increased to 120s to allow for network push

3. README.md (new at repo root)
   - Copied from artifacts/postiz-mobile/README.md so Gitea shows it
   - Added note that eas.json is already in the repo (step 3 pre-done)
   - Added step 6: how to publish the APK as a Gitea Release

4. artifacts/postiz-mobile/eas.json (new)
   - EAS build config for preview APK and production AAB

Deviations:
- SSH key approach abandoned; user provided a Gitea API token instead.
- Auth uses HTTPS + Authorization header, not SSH.
- .git/hooks/post-commit was write-restricted; post-merge.sh used instead.
- README.md and eas.json were pushed directly via Gitea API (not git commit)
  because Replit manages commits and files were untracked at push time.
- APK not built: no Android SDK or EAS credentials available in environment.

Replit-Task-Id: ffdb120c-59f0-41b1-91de-676c07ac1603
2026-05-03 12:28:40 +00:00
antoinepiron 2f0889ef4d Add comprehensive documentation for the mobile application
Create README.md with detailed instructions on features, installation, development, configuration, architecture, API usage, and build processes for the PostizMobile app.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7b0991ce-c7b8-4c82-9acc-fd3f9e762a01
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 86436427-f2f4-41a2-8d6b-bcc541098bd6
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/86064bd6-c937-4ca5-a5bf-bbef5749fb60/7b0991ce-c7b8-4c82-9acc-fd3f9e762a01/kWnlAIM
Replit-Helium-Checkpoint-Created: true
2026-05-03 12:04:32 +00:00
antoinepiron 9e4c9071e6 Add post status change notifications and set up Git push
Installs `expo-notifications` and `expo-task-manager` packages. Implements a `useNotifications` hook for requesting permissions, polling for post status changes, and sending local notifications for published or errored posts. Updates `app.json` to include notification permissions and the notification handler. Wires the `useNotifications` hook into the app's root layout.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7b0991ce-c7b8-4c82-9acc-fd3f9e762a01
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 7e5cd315-f570-494a-b5a6-c6ee284a4516
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/86064bd6-c937-4ca5-a5bf-bbef5749fb60/7b0991ce-c7b8-4c82-9acc-fd3f9e762a01/kWnlAIM
Replit-Helium-Checkpoint-Created: true
2026-05-03 11:48:45 +00:00
antoinepiron bbbcf9f586 Add core functionality for mobile post scheduling app
Adds necessary dependencies including axios and react-native-calendars to pnpm-lock.yaml.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7b0991ce-c7b8-4c82-9acc-fd3f9e762a01
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: dc1266fa-8375-43e1-aca0-9df31350f647
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/86064bd6-c937-4ca5-a5bf-bbef5749fb60/7b0991ce-c7b8-4c82-9acc-fd3f9e762a01/kWnlAIM
Replit-Helium-Checkpoint-Created: true
2026-05-03 11:41:45 +00:00
agent 5b0eedb94b Initial commit 2026-04-27 21:55:40 +00:00