Files
Nexus.Reader/src/.documentation/cache/summaries/NexusReader.UI.Shared__Layout__MainHubLayout.razor.json
T
2026-05-25 14:02:56 +02:00

1 line
7.8 KiB
JSON

{"path":"NexusReader.UI.Shared/Layout/MainHubLayout.razor","purpose":"Renders the main application hub layout (sidebar + main content) for authenticated users and coordinates initial identity sync and logout behavior.","classification":{"role":"ui-component","layer":"frontend","confidence":0.9,"evidence":["Frontend path heuristic","Inherits LayoutComponentBase (line 1) — Blazor layout component","Uses AuthorizeView, NavLink and injects AuthenticationStateProvider / IIdentityService (lines 8, 19, 88-90)"]},"className":"MainHubLayout","methods":[{"name":"OnInitializedAsync","line":94,"endLine":105,"signature":"() -> Task","purpose":"Component initialization: avoids duplicate syncs, checks authentication state, and attempts to sync profile from server if the user is not authenticated.","calls":[{"targetFile":"NexusReader.Application.Abstractions.Services/IIdentityService.cs","targetMethod":"GetProfileAsync","callLine":103,"paramSummary":"none"}],"actions":[{"id":"oninitializedasync_guard-clause_96_0","kind":"guard-clause","label":"Guards early exit or rejection path","line":96,"detail":"if (_isSyncing) return;","conditionSummary":"_isSyncing","outcomeLabels":["exit","continue"],"visibility":"primary-visible","confidence":0.9},{"id":"guard-clause_96","kind":"guard-clause","label":"Prevent re-entrant sync","line":96,"detail":"if (_isSyncing) return;","conditionSummary":"_isSyncing","outcomeLabels":["return","continue"],"visibility":"detail-only","confidence":0.7},{"id":"external-call_98","kind":"external-call","label":"Read authentication state","line":98,"detail":"await AuthStateProvider.GetAuthenticationStateAsync() (framework call)","visibility":"detail-only","confidence":0.7},{"id":"oninitializedasync_await_98_1","kind":"await","label":"Waits for async work","line":98,"detail":"var authState = await AuthStateProvider.GetAuthenticationStateAsync();","visibility":"secondary-visible","confidence":0.81},{"id":"oninitializedasync_branch_99_2","kind":"branch","label":"Evaluates branch condition","line":99,"detail":"if (!authState.User.Identity?.IsAuthenticated ?? true)","conditionSummary":"!authState.User.Identity?.IsAuthenticated ?? true","outcomeLabels":["true","false"],"visibility":"secondary-visible","confidence":0.78},{"id":"branch_99","kind":"branch","label":"If not authenticated, trigger server sync","line":99,"detail":"Sets _isSyncing and attempts a server-side profile sync to reconcile cookie/session state.","conditionSummary":"!authState.User.Identity?.IsAuthenticated ?? true","outcomeLabels":["set _isSyncing true","call IdentityService.GetProfileAsync"],"visibility":"detail-only","confidence":0.7},{"id":"state-change_101","kind":"mapping","label":"Mark sync in progress","line":101,"detail":"_isSyncing = true","visibility":"detail-only","confidence":0.7},{"id":"external-call_103","kind":"external-call","label":"Attempt to fetch profile from server","line":103,"detail":"await IdentityService.GetProfileAsync(); (project service)","visibility":"detail-only","confidence":0.7},{"id":"oninitializedasync_await_103_3","kind":"await","label":"Waits for async work","line":103,"detail":"await IdentityService.GetProfileAsync();","visibility":"secondary-visible","confidence":0.81}]},{"name":"HandleLogout","line":107,"endLine":111,"signature":"() -> Task","purpose":"Performs logout via the identity service and redirects the browser to a logout form route.","calls":[{"targetFile":"NexusReader.Application.Abstractions.Services/IIdentityService.cs","targetMethod":"LogoutAsync","callLine":109,"paramSummary":"none"}],"actions":[{"id":"external-call_109","kind":"external-call","label":"Invoke logout on identity service","line":109,"detail":"await IdentityService.LogoutAsync(); (project service)","visibility":"detail-only","confidence":0.7},{"id":"handlelogout_await_109_0","kind":"await","label":"Waits for async work","line":109,"detail":"await IdentityService.LogoutAsync();","visibility":"secondary-visible","confidence":0.81},{"id":"external-call_110","kind":"external-call","label":"Navigate to logout page","line":110,"detail":"NavigationManager.NavigateTo(\"/account/logout-form\", true) (framework navigation)","visibility":"detail-only","confidence":0.7}]}],"types":[],"serviceRegistrations":[],"startupActions":[],"dependencies":["NexusReader.Application.Abstractions.Services/IIdentityService.cs","NexusReader.UI.Shared.Components/Molecules/NexusIcon.razor"],"patterns":["Blazor Layout","Dependency Injection"],"domainConcepts":["Authentication / Identity","Navigation / Routing","UI Layout (Sidebar + Content)"],"keyDetails":"Uses an _isSyncing flag to avoid concurrent profile-sync attempts. On init, checks authentication state and if unauthenticated attempts a server-side profile sync (cookie-based). Logout calls the identity service and then forces navigation to an account logout form.","orchestrationMethods":[{"name":"OnInitializedAsync","line":94,"confidence":0.98,"reason":"Contains 4 architectural actions relevant to business execution.","actionKinds":["guard-clause","external-call","await","branch","mapping"],"evidencePaths":["NexusReader.UI.Shared/Layout/MainHubLayout.razor","NexusReader.Application.Abstractions.Services/IIdentityService.cs"]},{"name":"HandleLogout","line":107,"confidence":0.77,"reason":"Contains 2 architectural actions relevant to business execution.","actionKinds":["external-call","await"],"evidencePaths":["NexusReader.UI.Shared/Layout/MainHubLayout.razor","NexusReader.Application.Abstractions.Services/IIdentityService.cs"]}],"typedContracts":[],"persistenceInteractions":[],"externalInteractions":[{"methodName":"OnInitializedAsync","line":98,"kind":"external-call","detail":"await AuthStateProvider.GetAuthenticationStateAsync() (framework call)","evidencePaths":["NexusReader.UI.Shared/Layout/MainHubLayout.razor"]},{"methodName":"OnInitializedAsync","line":103,"kind":"external-call","detail":"await IdentityService.GetProfileAsync(); (project service)","evidencePaths":["NexusReader.UI.Shared/Layout/MainHubLayout.razor"]},{"methodName":"HandleLogout","line":109,"kind":"external-call","detail":"await IdentityService.LogoutAsync(); (project service)","evidencePaths":["NexusReader.UI.Shared/Layout/MainHubLayout.razor"]},{"methodName":"HandleLogout","line":110,"kind":"external-call","detail":"NavigationManager.NavigateTo(\"/account/logout-form\", true) (framework navigation)","evidencePaths":["NexusReader.UI.Shared/Layout/MainHubLayout.razor"]}],"evidenceAnchors":[{"kind":"orchestration-method","label":"OnInitializedAsync","line":94,"summary":"Contains 4 architectural actions relevant to business execution.","confidence":0.98,"evidencePaths":["NexusReader.UI.Shared/Layout/MainHubLayout.razor","NexusReader.Application.Abstractions.Services/IIdentityService.cs"]},{"kind":"orchestration-method","label":"HandleLogout","line":107,"summary":"Contains 2 architectural actions relevant to business execution.","confidence":0.77,"evidencePaths":["NexusReader.UI.Shared/Layout/MainHubLayout.razor","NexusReader.Application.Abstractions.Services/IIdentityService.cs"]},{"kind":"external-call","label":"OnInitializedAsync","line":98,"summary":"await AuthStateProvider.GetAuthenticationStateAsync() (framework call)","confidence":0.8,"evidencePaths":["NexusReader.UI.Shared/Layout/MainHubLayout.razor"]},{"kind":"external-call","label":"OnInitializedAsync","line":103,"summary":"await IdentityService.GetProfileAsync(); (project service)","confidence":0.8,"evidencePaths":["NexusReader.UI.Shared/Layout/MainHubLayout.razor"]},{"kind":"external-call","label":"HandleLogout","line":109,"summary":"await IdentityService.LogoutAsync(); (project service)","confidence":0.8,"evidencePaths":["NexusReader.UI.Shared/Layout/MainHubLayout.razor"]}],"cacheMetadata":{"schemaVersion":2,"analysisVersion":"2026-05-23.cache-v1","contentChecksum":"e67d2632fbbcfcb36c1cfa5cf50e87bf56c1347faf78879021d909fdf3acb1c5","sourceByteSize":4654,"analyzedAt":"2026-05-23T16:28:43.459Z","technology":"dotnet"}}