feat: implement dashboard mobile responsiveness v3 overhaul (#80)

This pull request implements **Mobile Responsiveness (v3) and a High-Fidelity Overhaul** for the dashboard view layer (`/dashboard`, `/catalog`, `/my-books`, `/profile`), matching the design aesthetics of the production mobile e-reader layout.

### Key Changes
1. **Re-engineered Floating Navigation Dock Capsule:**
   - Detached bottom capsule, floating 16px off the bottom with rounded `30px` borders.
   - Glassmorphic look in dark mode (`rgba(26, 26, 30, 0.75)`) and sepia theme in light mode (`rgba(244, 241, 234, 0.9)`).
   - Removed `translateY` offset on the central "AI" action button (robot icon inside a solid green circle).
   - Used `::deep` overrides to clean up text colors and icons, preventing browser visited link purple color defaults on `NavLink` items.
   - Restored compact standalone text labels under the navigation icons.
2. **Dashboard Layout Scale Compression & Fold Optimization:**
   - Compressed profile header avatar (`40px`), welcome title font size, and status pill spacing.
   - Compressed the `concepts-linear-stack` height to `120px` with scrolling.
   - Reduced book cover heights inside `MyBooks` to `200px` on mobile viewports.
3. **Current Reading Widget & Layout Margin Safety:**
   - Localized the widget button label to `"Kontynuuj czytanie"`.
   - Used safe area clearances (`calc(1.5rem + 72px + env(safe-area-inset-bottom))`) at the bottom of pages to prevent content from being covered by the capsule.
4. **Resolved Horizontal Layout Width Blowout (Grid Fix):**
   - Discovered that `.secondary-grid` was using flex layout inherited from desktop rather than grid layout on mobile.
   - Nowrap paragraphs in the concept list stretched the flex container to over 12,000 pixels wide, breaking the entire dashboard layout width.
   - Overrode `.secondary-grid` to `display: grid !important` on mobile, properly constraining layout width and allowing nowrap concept text truncation.

### Verification
- All code changes compiled successfully under `dotnet build NexusReader.slnx --no-restore` (0 errors).
- Validated correct layouts in list view, chart view, and light/dark theme toggles on a Samsung Galaxy S20 Ultra (412x915) viewport.

---------

Co-authored-by: Marek Jasiński <jasins.marek@gmail.com>
Reviewed-on: #80
Co-authored-by: Antigravity <antigravity@google.com>
Co-committed-by: Antigravity <antigravity@google.com>
This commit was merged in pull request #80.
This commit is contained in:
2026-06-08 11:05:57 +00:00
committed by Marek Jaisński
parent 9291bde531
commit 9fddafa423
10 changed files with 707 additions and 84 deletions
+101 -42
View File
@@ -7,6 +7,8 @@
@inject IIdentityService IdentityService
@inject NavigationManager NavigationManager
@inject ISyncService SyncService
@inject IJSRuntime JS
@using Microsoft.JSInterop
@attribute [Authorize]
@implements IDisposable
@@ -54,55 +56,86 @@
<section class="integration-card glass-panel">
<div class="panel-header">
<h4>Integracja Wiedzy</h4>
<NexusIcon Name="arrow-right" Size="16" />
<button class="view-toggle-btn" @onclick="ToggleGraphMode" type="button" aria-label="Toggle View">
<NexusIcon Name="@(_showSimplifiedList ? "map" : "list")" Size="14" />
<span>@(_showSimplifiedList ? "Pokaż Wykres" : "Pokaż Listę")</span>
</button>
</div>
<div class="graph-placeholder">
<div class="graph-node central" title="Ośrodek Wiedzy Nexus Reader"></div>
@if (_profile?.MappedConcepts != null && _profile.MappedConcepts.Any())
{
<div @key='"satellite-concepts-container"' style="display: contents;">
@for (int i = 0; i < _profile.MappedConcepts.Count; i++)
{
var concept = _profile.MappedConcepts[i];
var angle = i * (360.0 / _profile.MappedConcepts.Count);
var dist = 65;
<div @key="concept.Id" class="graph-node satellite"
style="--angle: @(angle)deg; --dist: @(dist)px;"
title="[@concept.Type] @concept.Content"
@onmouseover="() => SetHoveredConcept(concept)"
@onmouseout="ClearHoveredConcept">
</div>
}
</div>
}
else
{
<div @key='"satellite-placeholders-container"' style="display: contents;">
<div @key='"satellite-placeholder-0"' class="graph-node satellite" style="--angle: 0deg; --dist: 60px;"></div>
<div @key='"satellite-placeholder-1"' class="graph-node satellite" style="--angle: 120deg; --dist: 50px;"></div>
<div @key='"satellite-placeholder-2"' class="graph-node satellite" style="--angle: 240deg; --dist: 70px;"></div>
</div>
}
<div class="active-node-label">
@(string.IsNullOrEmpty(_hoveredConceptLabel) ? "TU JESTEŚ" : _hoveredConceptLabel)
</div>
</div>
@if (_hoveredConcept != null)
@if (_showSimplifiedList)
{
<div class="concept-detail-toast">
<span class="concept-type">@_hoveredConcept.Type</span>
<p class="concept-content">@_hoveredConcept.Content</p>
<div class="concepts-linear-stack">
@if (_profile?.MappedConcepts != null && _profile.MappedConcepts.Any())
{
<div class="concept-linear-list">
@foreach (var concept in _profile.MappedConcepts)
{
<div class="concept-linear-item">
<span class="concept-badge @concept.Type.ToLower()">@concept.Type</span>
<span class="concept-text" title="@concept.Content">@concept.Content</span>
</div>
}
</div>
}
else
{
<div class="concepts-empty-list">
<NexusIcon Name="info" Size="20" />
<p>Brak pojęć. Rozpocznij czytanie, aby AI wyodrębniło kluczowe koncepty.</p>
</div>
}
</div>
}
else
{
<div class="concept-detail-toast placeholder">
<span class="concept-type">Mapowanie AI</span>
<p class="concept-content">Najedź na węzeł, aby zbadać pojęcie wydobyte przez Nexus AI.</p>
<div class="graph-placeholder">
<div class="graph-node central" title="Ośrodek Wiedzy Nexus Reader"></div>
@if (_profile?.MappedConcepts != null && _profile.MappedConcepts.Any())
{
<div @key='"satellite-concepts-container"' style="display: contents;">
@for (int i = 0; i < _profile.MappedConcepts.Count; i++)
{
var concept = _profile.MappedConcepts[i];
var angle = i * (360.0 / _profile.MappedConcepts.Count);
var dist = 65;
<div @key="concept.Id" class="graph-node satellite"
style="--angle: @(angle)deg; --dist: @(dist)px;"
title="[@concept.Type] @concept.Content"
@onmouseover="() => SetHoveredConcept(concept)"
@onmouseout="ClearHoveredConcept">
</div>
}
</div>
}
else
{
<div @key='"satellite-placeholders-container"' style="display: contents;">
<div @key='"satellite-placeholder-0"' class="graph-node satellite" style="--angle: 0deg; --dist: 60px;"></div>
<div @key='"satellite-placeholder-1"' class="graph-node satellite" style="--angle: 120deg; --dist: 50px;"></div>
<div @key='"satellite-placeholder-2"' class="graph-node satellite" style="--angle: 240deg; --dist: 70px;"></div>
</div>
}
<div class="active-node-label">
@(string.IsNullOrEmpty(_hoveredConceptLabel) ? "TU JESTEŚ" : _hoveredConceptLabel)
</div>
</div>
@if (_hoveredConcept != null)
{
<div class="concept-detail-toast">
<span class="concept-type">@_hoveredConcept.Type</span>
<p class="concept-content">@_hoveredConcept.Content</p>
</div>
}
else
{
<div class="concept-detail-toast placeholder">
<span class="concept-type">Mapowanie AI</span>
<p class="concept-content">Najedź na węzeł, aby zbadać pojęcie wydobyte przez Nexus AI.</p>
</div>
}
}
</section>
@@ -173,6 +206,32 @@
private UserProfileDto? _profile;
private MappedConceptDto? _hoveredConcept;
private string _hoveredConceptLabel = string.Empty;
private bool _showSimplifiedList = false;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
try
{
var isMobile = await JS.InvokeAsync<bool>("eval", "window.innerWidth < 768");
if (isMobile)
{
_showSimplifiedList = true;
StateHasChanged();
}
}
catch
{
// Fallback for tests or prerendering
}
}
}
private void ToggleGraphMode()
{
_showSimplifiedList = !_showSimplifiedList;
}
protected override async Task OnInitializedAsync()
{