Commit graph

1048 commits

Author SHA1 Message Date
Paulo Castellano
7b37190358
Merge pull request #128 from dantaspaulo/feat/ai-brand-colors-toggle
feat(ai-create): let users choose brand colors or free AI colors for images
2026-07-18 15:17:44 -03:00
Paulo Castellano
2c2ab69e68 Merge main + finalize AI brand-colors toggle
Resolves the AiPostWizard conflict and completes the feature:
- i18n parity: brand_colors_label + brand_colors_description in all 15 locales
  (was en/es/pt-BR only, which broke LocalizationParityTest).
- Reworked the two-button toggle into a Switch with an explanatory description
  (matches the settings Switch/card pattern).
- Only shown for templates that honor the flag: added appliesBrandVisuals() to
  the AiContentTemplate contract (ImageCard=true, tweet cards=false), exposed as
  applies_brand_visuals in the create-page DTO, and gated the toggle on it — so
  it no longer appears (as a no-op) for tweet-card styles.
- Tests: TemplateContractTest covers appliesBrandVisuals for all templates.
2026-07-18 15:12:26 -03:00
Paulo Castellano
d0c32751d7
Merge pull request #147 from dantaspaulo/feat/settings-into-user-menu
refactor(sidebar): move Settings from the sidebar footer into the user menu
2026-07-18 14:49:07 -03:00
Paulo Castellano
0544b3a915 Merge remote-tracking branch 'origin/main' into feat/settings-into-user-menu
# Conflicts:
#	resources/js/components/AppSidebar.vue
2026-07-18 14:46:09 -03:00
Paulo Castellano
e4806c7662 refactor(sidebar): show Profile before Settings in the user menu 2026-07-18 14:42:45 -03:00
Paulo Castellano
132f84f404
Merge pull request #187 from trypostit/feat/mobile-experience
Improve the mobile experience (post editor + app-wide polish)
2026-07-18 14:37:22 -03:00
Paulo Castellano
f63286efd4 fix(sidebar): open the workspace menu to the side on desktop with a matching icon
The workspace switcher now opens to the right on desktop (like the user menu)
and stays below the trigger on mobile, via useSidebar()'s isMobile. The trigger
icon follows the direction: chevron-right on desktop, an up/down selector on
mobile — for both the workspace switcher and the user menu.
2026-07-18 14:34:15 -03:00
Paulo Castellano
bc93667fcf fix(mobile): clear the hamburger and match its size on the scheduled editor banner
The scheduled-post banner in the editor now clears the floating sidebar
trigger on mobile (pl-12 md:pl-0), aligns its calendar icon to the top of
the text, and matches the hamburger's size (size-10 md:size-9). Desktop is
unchanged.
2026-07-18 14:17:18 -03:00
Paulo Castellano
2c52c90b6e fix(mobile): polish automations, dialogs, workspaces and post views
- automations: minimal back-only header on mobile for the workflow builder
  and detail tabs (extracted AutomationMobileBackHeader); open live
  automations on the metrics tab (drafts still open on workflow); full-width
  status filter + refresh on the invocations toolbar; use IconMenu2 for the
  mobile sidebar trigger
- dialogs: stack DialogFooter primary-on-top / cancel-at-bottom on mobile
- workspaces: bring the workspace picker cards into the neo-brutalist design
- posts: left-align the label filter content; wrap the post-view date/status
  header so a long status badge no longer squeezes the date; add hamburger
  clearance to the editor's mobile tab bar
2026-07-18 10:58:07 -03:00
Paulo Castellano
e94f2cfe96 fix(posts): hide the autosave status in the mobile switcher
It's only the autosave indicator (Draft/Saving/Saved) and it crowded the tabs.
Drop it from the mobile switcher (the desktop header still shows it) so the tabs
get the full bar.
2026-07-18 09:35:50 -03:00
Paulo Castellano
708f1adbd2 fix(posts): align the mobile switcher bar with the sidebar trigger
Use py-3 so the tabs sit at the same vertical position as the top-3 hamburger,
and rounded-md so the tab corners match the trigger.
2026-07-18 09:32:23 -03:00
Paulo Castellano
119edef5b9 fix(posts): mobile editor — taller switcher tabs and a wider Post now button
Match the switcher tab height to the sidebar trigger (h-10), and let the primary
publish button fill the footer (flex-1) on mobile while staying auto-width on desktop.
2026-07-18 09:28:07 -03:00
Paulo Castellano
da5066e43e fix(posts): merge the editor status into the mobile switcher bar
On mobile the header was a whole bar showing only the Draft/Saving/Saved status.
Move that status into the switcher bar (right side) and hide the header on mobile
(the scheduled banner still shows), reclaiming a row. The switcher clears the
floating hamburger when it's the top bar.
2026-07-18 09:20:51 -03:00
Paulo Castellano
b7351667e2 fix(posts): tidy the post-view header on mobile
Stack it into a clean back-button row and a date + status row (date left, badge
right) instead of cramming everything into one line where the date wrapped and
the badge floated.
2026-07-18 09:06:56 -03:00
Paulo Castellano
fd557fe559 fix(ui): align the mobile sidebar trigger with the header buttons
Move the floating hamburger from left-2/top-2 to left-4/top-3 so it lines up
with the header's content padding (and the calendar's nav buttons); bump the
non-header page top reserve to pt-14 to clear the taller trigger.
2026-07-18 08:59:55 -03:00
Paulo Castellano
13e5bdb761 fix(ui): match the mobile sidebar trigger to the icon button size
The floating hamburger was size-9 (36px) next to size-10 (40px) icon buttons, so
it read as too small. Bump it to size-10 to match.
2026-07-18 08:55:49 -03:00
Paulo Castellano
0716ea0bd5 fix(posts): mobile calendar header — nav + compact date on row 1, full-width New post below
Move Today up with prev/next, keep the date picker compact on the right instead
of full-width, and give New post its own full-width row.
2026-07-18 08:38:09 -03:00
Paulo Castellano
6e0d663fc7 fix(posts): redesign the mobile calendar header
Split the header into a dedicated mobile layout (< lg) and the desktop grid.
Mobile is two clean rows: prev / date picker (fills) / next, then Today +
full-width New post. Fixes the stretched, styleless Today button. Each header
owns its own controls, so the date picker and view switcher no longer need
lg:hidden / hidden lg:block toggles.
2026-07-18 08:33:17 -03:00
Paulo Castellano
3de62ec2e3 fix(posts): stack the posts index toolbar into full-width rows on mobile
Search, label filter, and New post each take their own full-width row below sm
(inline on desktop). The label filter trigger goes full-width to match.
2026-07-17 21:20:52 -03:00
Paulo Castellano
6ead4eee84 fix(analytics): full-width account selector on mobile
Matches the date-range picker below it instead of sitting content-width.
2026-07-17 21:16:43 -03:00
Paulo Castellano
07c2e7cbf3 fix(posts): tidy the mobile calendar header
- Show/hide the date picker and view switcher with Tailwind (lg:hidden /
  hidden lg:block) instead of the isMobile ref; isMobile now only drives
  effectiveView (which changes navigation behavior, not just visibility)
- Full-width buttons on mobile: prev / Today (fills) / next, and the date
  picker fills the row next to New post
2026-07-17 21:16:43 -03:00
Paulo Castellano
fe721d490b refactor(posts): render PostEditorActions once in the editor header
The scheduled and editable states each rendered their own copy; the actions
component already decides internally what to show, so it only needs one instance
pushed right with ml-auto.
2026-07-17 21:16:43 -03:00
Paulo Castellano
d3738a2ec1 fix(ui): stop the scrollable tabs list from clipping button borders
overflow-x-auto forces overflow-y to auto too, so the tab triggers' border and
shadow were clipped at the list edges (visible on the editor Preview/Channels/
Comments tabs). Drop the fixed h-10 and pad the list (p-1) so the scroll
container has room around the buttons on all sides.
2026-07-17 20:58:53 -03:00
Paulo Castellano
f9a1731073 fix(auth): stop AuthSplitLayout overflowing on mobile with wide content
The mobile grid column was implicit (auto), so it sized to content — a long
workspace name (truncate = nowrap, wide intrinsic size) stretched the form
column to its max-w-lg (512px) and overflowed a 375px viewport by ~31px on the
workspaces list. Make the column an explicit minmax(0,1fr) track and give the
grid item min-w-0 so it stays within the viewport and the name truncates.

Found by a runtime horizontal-overflow check; adds MobileOverflowTest guarding
it across the layout variants (AuthLayout, default, full-width editor, detail).
2026-07-17 20:00:13 -03:00
Paulo Castellano
2013808312 fix(ui): third-pass mobile fixes
- AutomationHeader reserves space for the floating hamburger on mobile (its full-width pages had the back button under the trigger)
- AlertDialogContent caps height + scrolls like DialogContent
- AiGenerateDialog preview wraps long tokens (break-words)
- Enlarge notification panel action buttons on the full-width mobile panel (max-sm:size-9)
- min-w-0 so the billing processing title-bar label can truncate
2026-07-17 19:41:52 -03:00
Paulo Castellano
3d33d0d380 fix(posts): enlarge the platform logo badge in the preview switcher on mobile 2026-07-17 19:27:09 -03:00
Paulo Castellano
e31116c4b7 fix(posts): scale the preview phone mockup down on mobile for side padding
The 380px mockup frame is wider than a phone viewport, so it sat edge-to-edge. Scale it to 90% below lg (origin top-center keeps it centered) so there's clean symmetric padding to the screen edges. Reverts the now-redundant px-2 container tweak back to px-4.
2026-07-17 19:24:55 -03:00
Paulo Castellano
ca42a9f0ef fix(posts): tighten preview padding to px-2 on mobile so the phone mockup fits pixel-perfect 2026-07-17 19:18:00 -03:00
Paulo Castellano
f5a9e40bc1 refactor(ui): mobile polish and dead-state cleanup from review
- Restore desktop tab spacing (lg:gap-6) on the automation tabs
- break-words / viewport width caps on the AI review chips, lightbox alt overlay, and pick-time popover
- Remove the now-unused hoveredCommentId state after the comment toolbar became touch-visible
2026-07-17 19:15:58 -03:00
Paulo Castellano
a4ed3bcdad fix(ui): mobile fixes from second-pass review
- NotificationBell panel was fixed at left-[17rem] w-[22rem] and ran off-screen on a phone; now full-width-with-margins below sm
- Reserve top space for the floating sidebar trigger so page headings no longer sit under the hamburger on mobile
- automations/Index header stacks on mobile (was the one index page the first pass missed)
- Contain the preview phone mockup horizontally so it never breaks the page on narrow screens
- Comment bodies wrap long unbroken tokens (break-words)
2026-07-17 19:15:58 -03:00
Paulo Castellano
15eef28161 fix(ui): mobile polish — responsive headings, menu placement, truncation
PageHeader downscales on phones; workspace switcher opens within the viewport; OAuth page-selects go icon-only + truncate; invite info rows truncate.
2026-07-17 18:38:21 -03:00
Paulo Castellano
5118640a9c feat(automations): mobile-safe builder with desktop notice
The node builder is gated to lg+ (its fixed side panels no longer overflow a phone); below lg it shows a 'works best on a larger screen' notice. Automation tabs scroll instead of cutting off.
2026-07-17 18:38:20 -03:00
Paulo Castellano
49282d2acb fix(ui): stack page headers and toolbars on mobile
Non-wrapping justify-between headers now stack below sm; fixed-width searches go full-width. Calendar header wraps and seeds isMobile at setup to avoid the month-grid flash.
2026-07-17 18:38:20 -03:00
Paulo Castellano
ccf888258d feat(assets): touch-friendly gallery card actions on mobile
Uploads/Unsplash/Giphy card actions are visible on touch instead of hover-only, without the dark scrim on small screens.
2026-07-17 18:38:20 -03:00
Paulo Castellano
b7b3809790 feat(posts): make the post editor usable on mobile
- Top switcher (Compose / Channels / Preview / Comments) reveals the panel that was hidden below lg
- Sticky bottom action bar puts schedule/publish/delete within thumb reach
- Composer media actions and comment toolbar are visible on touch (no hover needed); media grid is 3-up
- Clamp media picker and emoji picker widths to the viewport
2026-07-17 18:38:20 -03:00
Paulo Castellano
a92a87ac46 fix(ui): make tabs scrollable and clamp dialogs/trigger for mobile
- TabsList scrolls horizontally instead of overflowing the page
- DialogContent caps height with internal scroll; DialogScrollContent gets the mobile width gutter
- SidebarTrigger tap target bumped to 36px
2026-07-17 18:38:20 -03:00
Paulo Castellano
5f0346951d
Merge pull request #185 from trypostit/fix/bluesky-link-preview-card
Link preview cards for Bluesky, X and Threads
2026-07-17 16:37:16 -03:00
Paulo Castellano
8866e4ed46 fix(posts): cache the link card as an array, not the DTO
The link-card cache stored a LinkCardMetadata object, which does not round-trip through the Redis cache driver — a cache hit came back as __PHP_Incomplete_Class and 500'd the preview endpoint. Cache the plain array (toArray) and rebuild the DTO via a new fromArray(). Primitives round-trip cleanly through every driver. The cache test now asserts a primitive is stored and a hit reconstructs the DTO; the array cache driver used in tests hid the bug because it never serializes.
2026-07-17 16:34:04 -03:00
Paulo Castellano
925fd85b95 refactor(posts): return the card display domain from the backend
Compute the bare display host once in LinkCardMetadata (via Laravel's Uri::host + Str::chopStart) and return it as card.domain, so the LinkCard component renders it directly instead of parsing the URL client-side. The component is now purely presentational.
2026-07-17 16:24:23 -03:00
Paulo Castellano
7c79b331f6 refactor(posts): drop the frontend URL trim, rely on the backend's clean uri
The link-preview endpoint re-runs UrlDetector on whatever it receives and returns the exact, trimmed URL as card.uri, so the composer only needs a rough match to detect and dedup a link. Removes the firstUrl helper's punctuation/paren trimming that mirrored the backend tokenizer, leaving one trivial regex.
2026-07-17 16:17:06 -03:00
Paulo Castellano
ec3f251401 refactor(posts): simplify the link-preview composable and card
Replace the hand-rolled debounce + watch + lastAttemptedUrl bookkeeping in useLinkCard with vueuse's watchDebounced over a computed URL — the watch only fires when the detected URL changes, so dedup and unmount cleanup come for free. Make firstUrl declarative (regex match + a single trim helper) and drop the www-strip regex in LinkCard for a plain startsWith/slice. Behavior unchanged: URL detection still mirrors the backend UrlDetector (verified against the same cases).
2026-07-17 15:57:51 -03:00
Paulo Castellano
2815a45de8 refactor(security): make the redirect-loop bound explicit in the for header
The manual redirect loop used an empty-condition for(;;) with the bound enforced only by an internal break; termination was correct but read like a mistake. Put the MAX_REDIRECTS bound in the loop header. No behavior change — the internal break still fires first.
2026-07-17 15:49:12 -03:00
Paulo Castellano
4a08913d70 fix(security): make SSRF private-network block configurable and guard the last user-URL fetches
Add config('trypost.security.allow_private_network') (env TRYPOST_ALLOW_PRIVATE_NETWORK, default off) so self-hosted operators can reach their own internal network; only the private-IP rejection is bypassed, scheme/host checks always apply. Add SafeHttpFetcher::guardedRequest() and route the last unguarded user-supplied-URL fetches through it: the Unsplash/Giphy asset import, the API/MCP attach-media-from-URL download, and the OAuth avatar download. Our-own-storage reads (media crop, Bluesky media) are intentionally left unguarded so internal storage keeps working when self-hosted.
2026-07-17 15:40:15 -03:00
Paulo Castellano
11d6bddf9c fix(security): guard automation node requests against redirect-SSRF
RunFetchRssNode, RunWebhookNode and RunHttpRequestNode guarded the initial URL but then followed redirects unguarded, so a public URL could 302 to an internal address. RSS now fetches through SafeHttpFetcher::get() (re-guards every hop); webhooks no longer follow redirects; the generic HTTP request node re-runs the SSRF guard on each hop via a new SafeHttpFetcher::redirectGuardOptions().
2026-07-17 14:55:56 -03:00
Paulo Castellano
9bb1f266e9 fix(security): re-validate SSRF on every redirect hop in SafeHttpFetcher
The shared fetcher guarded only the initial URL, then followed redirects without re-checking each hop, so a public page could 302 to an internal address. Follow redirects manually and run the SSRF guard on every hop; throw when the redirect cap is exceeded. Also hardens brand autofill and logo downloads.
2026-07-17 14:32:40 -03:00
Paulo Castellano
f84c6f818a feat(posts): show link preview card in the X and Threads editors
X and Threads auto-generate link cards server-side from the URL's meta tags, so no publish-side work is needed. Reuse the shared useLinkCard composable to render the card in their editor previews, gated on no attached media.
2026-07-17 14:32:40 -03:00
Paulo Castellano
8648ed9720 feat(bluesky): add link preview cards for posts
Bluesky does not hydrate link cards server-side, so build the app.bsky.embed.external embed at publish time: detect the first URL, scrape its OpenGraph metadata, and re-upload the og:image as the card thumb. Works for web, API and MCP. Adds a posts/link-preview endpoint so the editor renders the card live. The thumb download is SSRF-guarded and does not follow redirects.
2026-07-17 14:32:40 -03:00
Paulo Castellano
450b6fd3de
Merge pull request #127 from dantaspaulo/feat/ai-prompt-char-counter
feat(ai-create): show character counter under the AI prompt field
2026-07-17 11:29:59 -03:00
Paulo Castellano
e7f93f4aef refactor(ai-create): clarify prompt-rule naming and label the counter
- Rename AiPromptRules::promptRule() to wizardPromptRule() so the asymmetry is
  explicit: only the create wizard carries a minimum; the editor's generation
  reuses just the shared maximum.
- Add aria-live and a data-testid to the prompt counter so the over-limit state
  is announced to assistive tech and reachable from browser tests.
2026-07-17 11:26:15 -03:00
Paulo Castellano
c432034dd1 test(ai): guard prompt max on the editor endpoint and the wizard min boundary
- Assert GeneratePostContentRequest rejects a prompt over the shared max, so the
  editor's limit is pinned explicitly (not only implied by the create wizard).
- Assert the create wizard accepts a prompt at exactly the minimum length,
  complementing the below-minimum rejection.
2026-07-17 11:08:50 -03:00