Skip to content

Commit 0780f47

Browse files
andrasbacsaiclaude
andcommitted
feat: Add recents menu with pinnable pages
- Add "Recents" section in sidebar that tracks recently visited pages - Allow pinning up to 5 pages (starred items stay at top) - Show up to 5 pinned + 5 recent = 10 total items - Display pinned pages on Dashboard with dedicated section - Store recents/pins in JSON column per user+team - Real-time sync via WebSocket (RecentsUpdated event) - Rate limiting on pin toggle (10/minute server-side) - Client-side expand/collapse state (localStorage, no backend calls) - Automatic label/sublabel derivation from routes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 5699eaa commit 0780f47

File tree

11 files changed

+754
-3
lines changed

11 files changed

+754
-3
lines changed

app/Events/RecentsUpdated.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace App\Events;
4+
5+
use Illuminate\Broadcasting\InteractsWithSockets;
6+
use Illuminate\Broadcasting\PrivateChannel;
7+
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
8+
use Illuminate\Foundation\Events\Dispatchable;
9+
use Illuminate\Queue\SerializesModels;
10+
11+
class RecentsUpdated implements ShouldBroadcast
12+
{
13+
use Dispatchable, InteractsWithSockets, SerializesModels;
14+
15+
public function __construct(
16+
public int $userId
17+
) {}
18+
19+
public function broadcastOn(): array
20+
{
21+
return [
22+
new PrivateChannel("user.{$this->userId}"),
23+
];
24+
}
25+
26+
public function broadcastAs(): string
27+
{
28+
return 'RecentsUpdated';
29+
}
30+
}

app/Http/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Kernel extends HttpKernel
3939
\Illuminate\Routing\Middleware\SubstituteBindings::class,
4040
\App\Http\Middleware\CheckForcePasswordReset::class,
4141
\App\Http\Middleware\DecideWhatToDoWithUser::class,
42-
42+
\App\Http\Middleware\TrackRecentPages::class,
4343
],
4444

4545
'api' => [

0 commit comments

Comments
 (0)