Fix GUI polish issues across auth modal, theme, and 404
- Add missing modal CSS (.modal-overlay/.modal-dialog/.modal-header): the "Connect to Microsoft" auth modal was rendering unstyled inline at the bottom of the page. Now a centered dialog with backdrop. - Surface OAuth connect errors in the modal instead of silently reopening it with no explanation. - MainLayout: implement IDisposable so event handlers are actually unsubscribed (Dispose existed but was never invoked). - Wire up the Settings theme selector (was a dead control): drop the unsupported Dark option, call sptb.setTheme on save and on load, resolve System via prefers-color-scheme. - Add branded 404 page via UseStatusCodePagesWithReExecute + Routes <NotFound> (blank white page before). - Add .progress-fill.indeterminate animation and .progress-panel. - Home: replace inline JS hover handlers with a .feature-card CSS class. - Define missing --surface-2 variable referenced by MainLayout. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -29,8 +29,8 @@ else
|
||||
<div style="display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:16px;margin-top:16px">
|
||||
@foreach (var feature in _features)
|
||||
{
|
||||
<a href="@feature.Href" style="text-decoration:none">
|
||||
<div class="card" style="cursor:pointer;transition:box-shadow .15s" onmouseover="this.style.boxShadow='0 2px 8px rgba(0,120,212,.2)'" onmouseout="this.style.boxShadow=''">
|
||||
<a href="@feature.Href" style="text-decoration:none;color:inherit">
|
||||
<div class="card feature-card">
|
||||
<div style="font-size:28px;margin-bottom:8px">@feature.Icon</div>
|
||||
<div style="font-weight:600;margin-bottom:4px">@feature.Title</div>
|
||||
<div class="text-muted">@feature.Description</div>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
@page "/not-found"
|
||||
@attribute [Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
|
||||
<PageTitle>Page not found — SharePoint Toolbox</PageTitle>
|
||||
|
||||
<div class="no-profile">
|
||||
<h2>Page not found</h2>
|
||||
<p>The page you requested doesn't exist or has moved.</p>
|
||||
<a href="/" class="btn btn-primary">Back to Home</a>
|
||||
</div>
|
||||
@@ -1,7 +1,9 @@
|
||||
@page "/settings"
|
||||
@attribute [Authorize]
|
||||
@inject IUserSessionService Session
|
||||
@inject IJSRuntime JS
|
||||
@rendermode InteractiveServer
|
||||
@using Microsoft.JSInterop
|
||||
|
||||
<h1 class="page-title">Settings</h1>
|
||||
|
||||
@@ -19,7 +21,6 @@
|
||||
<select class="form-select" style="width:160px" @bind="_theme" @bind:after="Save">
|
||||
<option value="System">System</option>
|
||||
<option value="Light">Light</option>
|
||||
<option value="Dark">Dark</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -44,14 +45,15 @@
|
||||
{
|
||||
var s = Session.Settings;
|
||||
_lang = s.Lang;
|
||||
_theme = s.Theme;
|
||||
_theme = s.Theme is "System" or "Light" ? s.Theme : "System";
|
||||
_autoTakeOwnership = s.AutoTakeOwnership;
|
||||
}
|
||||
|
||||
private void Save()
|
||||
private async Task Save()
|
||||
{
|
||||
Session.UpdateSettings(new AppSettings { Lang = _lang, Theme = _theme, AutoTakeOwnership = _autoTakeOwnership });
|
||||
SharepointToolbox.Web.Localization.TranslationSource.Instance.SetCulture(_lang);
|
||||
await JS.InvokeVoidAsync("sptb.setTheme", _theme);
|
||||
_saved = true;
|
||||
StateHasChanged();
|
||||
_ = Task.Delay(2000).ContinueWith(_ => { _saved = false; InvokeAsync(StateHasChanged); });
|
||||
|
||||
Reference in New Issue
Block a user