2026-01-19 00:49:13 +00:00
|
|
|
<?php
|
|
|
|
|
|
refactor: settings redesign, Spanish translations, language system, strict_types
Settings pages:
- Redesign layout to match Sendkit (max-w-4xl, space-y-12, Separator sections)
- Merge Members page into Workspace settings with Table, invite Dialog, ConfirmDeleteModal
- Add workspace logo upload/delete routes and controller methods
- Translate all hardcoded strings in Workspace.vue modals
Language system:
- Drop languages table, replace language_id FK with locale string column on users
- Create config/languages.php for available languages and default locale
- Add Spanish (es) translations (13 files)
- Simplify HandleInertiaRequests, ProfileController, RegisteredUserController
Code quality:
- Add declare(strict_types=1) to all PHP files
- Fix MastodonPublisher using wrong attribute (filename -> original_filename)
- Fix HasMediaTest for new has_photo/photo_url accessors
- Fix PublishToSocialPlatformTest type error revealed by strict_types
- Remove orphaned Language model from AppServiceProvider morph map
- Update User TypeScript interface (has_photo, photo_url, locale)
- Eager load media relation on workspaces to prevent N+1
- Add 8 new tests for workspace logo upload/delete
- Update workspace settings test to assert members/invitations props
All 710 tests passing.
2026-03-30 03:20:43 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
2026-01-19 00:49:13 +00:00
|
|
|
use App\Mail\WorkspaceInvite;
|
2026-04-15 01:22:04 +00:00
|
|
|
use App\Models\Account;
|
|
|
|
|
use App\Models\Invite;
|
2026-03-29 22:24:28 +00:00
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
2026-01-19 00:49:13 +00:00
|
|
|
|
|
|
|
|
test('workspace invite mail has correct subject', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
$account = Account::factory()->create(['name' => 'Test Account']);
|
|
|
|
|
$invite = Invite::factory()->create([
|
|
|
|
|
'account_id' => $account->id,
|
2026-01-19 00:49:13 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$mail = new WorkspaceInvite($invite);
|
|
|
|
|
|
2026-04-15 01:22:04 +00:00
|
|
|
expect($mail->envelope()->subject)->toBe("You've been invited to join Test Account");
|
2026-01-19 00:49:13 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('workspace invite mail has correct content', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
$account = Account::factory()->create(['name' => 'My Team']);
|
|
|
|
|
$invite = Invite::factory()->create([
|
|
|
|
|
'account_id' => $account->id,
|
2026-01-19 00:49:13 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$mail = new WorkspaceInvite($invite);
|
|
|
|
|
$content = $mail->content();
|
|
|
|
|
|
|
|
|
|
expect($content->view)->toBe('mail.workspace-invite');
|
|
|
|
|
expect($content->with['title'])->toBe("You've been invited to join My Team");
|
2026-01-20 19:53:54 +00:00
|
|
|
expect($content->with['previewText'])->toBe("You've been invited to join My Team");
|
feat: @mentions in comments, AI Action layer + MCP tools, settings tabs
Mentions in post comments
- @mention autocomplete (workspace members, current user excluded) with
marker syntax @[uuid] persisted, display names rendered via CommentBody
chips; live edit replaces markers with names and converts back on save.
- NotifyMentions action with workspace-scoped membership check, dedupes
same user, only newly-added mentions on update.
- Email + in-app via SendNotification job, respecting per-user
notification_preferences.mentioned_in_comment.
- Heartbeat-based presence (Cache, 60s TTL, 30s ping) so online recipients
get only the in-app notification — no email noise.
- Real-time bell on workspace.{id}.user.{id} private channel
(NotificationCreated event), scoped channel name avoids client-side
filtering and lays out a convention for future workspace channels.
- Mailable localized via lang/{en,es,pt-BR}/mail.php; Maizzle source
template for the email is committed and built into resources/views/mail.
AI generation refactor (Action layer + MCP)
- Extracted Actions/Ai/Generate{Image,Video} with QuotaExhaustedException
so agent tools and MCP tools share a single domain entry point.
- Mcp/Tools/Ai/Generate{Image,Video}Tool registered in TryPostServer; both
return MediaResource payloads.
- Orientation::imageApiSize maps non-OpenAI ratios to 1:1/2:3/3:2.
- config/ai.php is now the single source of truth driven by env, removing
the trypost.ai shim. Default text/image providers flipped to OpenAI.
Settings/UX
- /settings/workspace split into shadcn Tabs (Workspace / Brand / Users)
with three components.
- /assets and the in-editor MediaPicker open the ImagePreviewDialog
lightbox on image click while preserving action button behaviour.
- Comments tab landed via ?tab=comments&comment=<id> from notification
click (scroll-to + temporary highlight).
- Mention autocomplete popover flips above when near the viewport bottom.
- Real social platform PNGs replace Tabler brand glyphs in schedule
pills and post list, with hover tooltip carrying display_name + handle.
Bug fixes
- AcceptInvite: controller now passes workspace + role payload that the
Vue page expects; login/register CTAs preselect the invite email.
- WorkspaceInvite mailable: stopped referencing nonexistent
$invite->workspace and $invite->role; column added to the migration,
Invite model casts role to WorkspaceRole, CreateInvite persists it.
- PostCommentCreated: added broadcastAs so .PostCommentCreated actually
matches the Echo listener; payload now includes mentioned_users so
receivers render the chip correctly without a refetch.
- Preview components for X/Pinterest/Threads/Bluesky/LinkedIn/Mastodon/
TikTok/YouTube switched from item.type === 'image' to
!isVideoMedia(item) so media without a persisted type still renders.
- UpdatePostRequest now accepts media.*.{type,mime_type,size,...} so the
posts.media JSON keeps the metadata that the previews need.
- Removed throttle:6,1 from social connect routes (was 429ing legitimate
OAuth retries).
- Used MediaType enum cases instead of literal 'image'/'video' strings
when creating media rows.
Tests
- MentionParser unit tests, NotifyMentions feature tests including
online/offline channel selection and preference gating, MCP AI tool
happy paths, MentionedInComment mailable rendering, AcceptInvite +
search-members + index mentioned_users path. 1229 passing.
2026-05-01 23:59:03 +00:00
|
|
|
expect($content->with['accountName'])->toBe('My Team');
|
|
|
|
|
expect($content->with['roleLabel'])->toBeString();
|
2026-03-29 22:24:28 +00:00
|
|
|
expect($content->with['url'])->toBe(route('app.invites.show', $invite->id));
|
2026-01-19 00:49:13 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('workspace invite mail has no attachments', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
$invite = Invite::factory()->create();
|
2026-01-19 00:49:13 +00:00
|
|
|
|
|
|
|
|
$mail = new WorkspaceInvite($invite);
|
|
|
|
|
|
|
|
|
|
expect($mail->attachments())->toBeEmpty();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test('workspace invite mail is queueable', function () {
|
2026-04-15 01:22:04 +00:00
|
|
|
$invite = Invite::factory()->create();
|
2026-01-19 00:49:13 +00:00
|
|
|
|
|
|
|
|
$mail = new WorkspaceInvite($invite);
|
|
|
|
|
|
2026-03-29 22:24:28 +00:00
|
|
|
expect($mail)->toBeInstanceOf(ShouldQueue::class);
|
2026-01-19 00:49:13 +00:00
|
|
|
});
|