Make imported/linked CSS always a full theme replacement (ticket 020)
Removes the "Use as theme" checkbox/is_theme distinction from NavMenu.tsx's CSS import and link forms — every imported/linked stylesheet is now always validated against the canonical --c-* variable set and becomes a selectable theme, same as today's is_theme:true path. Drops is_theme entirely from the backend (CssEntry, ImportCssRequest, LinkCssRequest, CssEntryDto) and from the frontend CssEntry type; an existing settings.json with a stored is_theme:false entry still deserializes fine (the field is simply unknown/ignored) and that entry becomes selectable like any other, so no migration step is needed. Also drops the now-dead always-on-overlay CSS injection path from useSettingsPanel.ts, and changes the CSS filename placeholder from "name.css" to "enter name". Implemented directly against main rather than merging the dispatched worktree branch for this ticket, since that branch's base predated ticket 012 (the custom-themes/imported-CSS consolidation) and its NavMenu structure no longer matched current main. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XFUNZwCvz3kcod3352ZR2o
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
f20359e655
commit
d6b7f7dfb6
+2
-8
@@ -392,13 +392,7 @@ async fn import_css(
|
||||
) -> impl IntoResponse {
|
||||
let css_dir = state.css_dir();
|
||||
let mut settings = state.settings.lock().unwrap();
|
||||
match settings.import_css(
|
||||
&state.settings_path,
|
||||
&css_dir,
|
||||
body.filename,
|
||||
&body.content,
|
||||
body.is_theme,
|
||||
) {
|
||||
match settings.import_css(&state.settings_path, &css_dir, body.filename, &body.content) {
|
||||
Ok(id) => {
|
||||
let entry = settings
|
||||
.css_entries
|
||||
@@ -417,7 +411,7 @@ async fn link_css(
|
||||
Json(body): Json<LinkCssRequest>,
|
||||
) -> impl IntoResponse {
|
||||
let mut settings = state.settings.lock().unwrap();
|
||||
match settings.link_css(&state.settings_path, body.path_or_url.clone(), body.is_theme) {
|
||||
match settings.link_css(&state.settings_path, body.path_or_url.clone()) {
|
||||
Ok(()) => {
|
||||
let entry = settings
|
||||
.css_entries
|
||||
|
||||
Reference in New Issue
Block a user