Files
takeone-youtube-clone/resources/views/layouts/partials/header.blade.php
T
ghassanandClaude Opus 4.7 a25af30700 fix(channel): grid, scoreboard thumb, sort hash, visitor privacy
Audit fixes against /channel/{slug}:

1. Fluid video grid — repeat(auto-fill, minmax(260px, 1fr)) replaces
   the three fixed breakpoints (3/2/4 cols at 1101/1500/… px) that
   produced different card widths and could overflow 390 / 1280 /
   1920. min-width:0 on every grid child so a long unbroken title
   (CJK, "SPARTAWORRIOR") can't widen its track past 1fr.
2. Scoreboard thumbnail — stop including vs-mini + scorebar-mini on
   match cards. Those partials leaked fighter names, "AKA/AO",
   "ROUND 1", "0:00" into the card DOM, showing stale 0-0 for
   finished matches and breaking title layout at narrow widths. The
   regular <img> above is the thumbnail now; VS intro + live scorebar
   still render on the full match player page where they belong.
3. Sort pills — Latest/Popular/Oldest now append #videos so the page
   stays on the Videos tab after reload instead of jumping to Wall.
4. Shorts tab — always render for the owner (so the "My Shorts"
   sidebar link always lands somewhere), with an empty-state card
   when no shorts exist. Visitors still see it only when shorts > 0.
5. Subscriptions sidebar link — href="#" replaced by a real
   /feed/subscriptions route backed by UserController@subscriptionsFeed
   that reuses the videos/index view with the subscription feed.
6. Header view count — totalViews now sums video_views over public
   videos for visitors (owner still sees the full total). Previously
   leaked unlisted and private video view counts.
7. Card redundancy — new hideChannelInfo prop on <x-video-card/>
   suppresses the per-card avatar + channel-name row. The channel
   page passes it; everywhere else keeps the row.
9. Decorative logo — the second <img alt="Play"> in the responsive
   header pair now has alt="" so a screen reader doesn't announce
   "Play Play". ⋮ menu button gets aria-label="More actions".
10. Privacy — age, gender, location and horoscope strip now only
    render to the owner on the channel header (horoscope strip is
    also allowed when the compatibility match-up is being shown to
    a signed-in visitor). Joined-month stays public.
11. Notifications dropdown — initial state is "No notifications"
    not an indefinite "Loading…". Opening the panel now shows a
    spinner while fetching, surfaces a Retry button on error, and
    bails out of the "Loading…" state on non-ok HTTP responses.

Title clamp — .yt-video-title is now a 2-line box with
overflow-wrap:anywhere so CJK titles and long words wrap mid-word
and can't widen the card past its track.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-10-21 10:03:39 +03:00

107 lines
5.2 KiB
PHP

<!-- Header -->
<header class="yt-header">
<div class="yt-header-left">
<button class="yt-menu-btn" onclick="toggleSidebar()">
<i class="bi bi-list fs-5"></i>
</button>
<a href="{{ route('home') }}" class="yt-logo">
{{-- Two responsive logos. The visible one at a given viewport
carries the app name; its sibling is display:none and gets
alt="" so a screen reader doesn't announce "Play Play". --}}
<img src="{{ asset('storage/images/logo.png') }}" alt="{{ config('app.name') }}" class="d-md-none" style="height:30px;">
<img src="{{ asset('storage/images/fullLogo.png') }}" alt="" class="d-none d-md-block" style="height:30px;">
</a>
</div>
<div class="yt-header-center d-none d-md-flex">
<div class="yt-search">
<form action="{{ route('videos.search') }}" method="GET" class="yt-search-form">
<input type="text" name="q" class="yt-search-input" placeholder="Search" value="{{ request('q') }}">
<button type="submit" class="yt-search-btn"><i class="bi bi-search"></i></button>
</form>
</div>
</div>
<div class="yt-header-right">
<!-- Mobile search -->
<button type="button" class="yt-icon-btn d-md-none" onclick="toggleMobileSearch()">
<i class="bi bi-search"></i>
</button>
@auth
<!-- Create / Upload -->
<button type="button" class="yt-upload-btn d-none d-md-flex"
onclick="openUploadChooser()">
<i class="bi bi-camera-video-fill"></i>
<span>Create</span>
</button>
<!-- Notifications -->
<div class="yt-notif-wrap" id="notifWrap">
<button type="button" class="yt-icon-btn" id="notifBtn"
onclick="toggleNotifPanel()" title="Notifications" aria-expanded="false">
<i class="bi bi-bell-fill"></i>
<span class="yt-notif-badge" id="notifBadge" style="display:none;"></span>
</button>
<div class="yt-notif-panel" id="notifPanel" style="display:none;" role="menu">
<div class="yt-notif-header">
<span class="yt-notif-title">Notifications</span>
<button type="button" class="yt-notif-mark-all" id="notifMarkAll"
onclick="markAllRead()" style="display:none;">Mark all read</button>
</div>
<div class="yt-notif-list" id="notifList">
<div class="yt-notif-empty" id="notifInitialState">No notifications</div>
</div>
</div>
</div>
<!-- User dropdown -->
<div class="yt-user-dropdown" id="headerUserDropdown">
<button class="yt-icon-btn" id="headerUserBtn"
onclick="toggleHeaderDropdown()" aria-expanded="false" aria-haspopup="true">
<img src="{{ Auth::user()->avatar_url }}"
class="yt-user-avatar" alt="{{ Auth::user()->name }}">
</button>
<div class="yt-user-panel" id="headerUserPanel" role="menu">
<div class="yt-panel-info">
<img src="{{ Auth::user()->avatar_url }}" alt="{{ Auth::user()->name }}">
<div style="min-width:0;">
<div class="yt-panel-name">{{ Auth::user()->name }}</div>
<div class="yt-panel-email">{{ Auth::user()->email }}</div>
</div>
</div>
<div class="yt-panel-links">
@if(Auth::user()->isSuperAdmin())
<a href="{{ route('admin.dashboard') }}" class="yt-drop-item">
<i class="bi bi-speedometer2"></i> Admin Dashboard
</a>
<div class="yt-panel-divider"></div>
@endif
<a href="{{ route('channel', Auth::user()->channel) }}" class="yt-drop-item">
<i class="bi bi-person-video3"></i> My Channel
</a>
<a href="{{ route('channel', Auth::user()->channel) }}#settings" class="yt-drop-item">
<i class="bi bi-gear"></i> Settings
</a>
<div class="yt-panel-divider"></div>
<form method="POST" action="{{ route('logout') }}" style="margin:0;">
@csrf
<button type="submit" class="yt-drop-item danger">
<i class="bi bi-box-arrow-right"></i> Sign Out
</button>
</form>
</div>
</div>
</div>
@else
<a href="{{ route('login') }}" class="yt-upload-btn">
<i class="bi bi-box-arrow-in-right"></i>
<span>Sign In</span>
</a>
@endauth
</div>
</header>