With a background image, menus use the surface transparency of Appearance (82% by default) instead of at least 92%, and they keep the blur. Hovered rows and controls in the work area, hovered menu rows, and the workspace button use the new --rs-hover-bg token. With an image, it is a 6% veil of the strong text color. The image stays visible, and the hover shows over light and dark image areas. Without an image, nothing changes. Silver Serpent dim text is now #c2c6cc. It keeps 4.5:1 contrast on a hovered row over a white image. UI-061 replaces the image rule of UI-043. Card 05b9bfa1.
31 lines
1.9 KiB
Svelte
31 lines
1.9 KiB
Svelte
<script lang="ts">
|
|
import { t } from "$lib/i18n";
|
|
import Icon from '$lib/ui/Icon.svelte';
|
|
import IconButton from '$lib/ui/IconButton.svelte';
|
|
import { state as browserState, request } from './client';
|
|
import { engine, engineReady } from './engine';
|
|
let { open }: { open: (profileId: string, url: string) => Promise<void> } = $props();
|
|
let error = $state('');
|
|
// The bookmarks live in the engine. A missing engine is not started here.
|
|
const installed = $derived(engineReady($engine));
|
|
let loaded = false;
|
|
$effect(() => {
|
|
if (!installed) { loaded = false; return; }
|
|
if (loaded) return;
|
|
loaded = true;
|
|
void request('state').catch(reason => error = String(reason));
|
|
});
|
|
</script>
|
|
<div class="bookmarks">
|
|
{#if !installed}<p class="note">{$t("Install the browser engine to see the browser bookmarks.")}</p>{/if}
|
|
{#if error}<p class="error" role="alert">{error}</p>{/if}
|
|
{#each installed ? $browserState?.bookmarks || [] : [] as item (item.id)}
|
|
<div class="row"><button class="link" title={item.url} onclick={() => void open(item.profileId, item.url)}><Icon icon="globe" /><span>{item.title}</span></button><IconButton icon="close" label={`Remove ${item.title}`} onclick={() => void request('removeBookmark', { id: item.id })} /></div>
|
|
{/each}
|
|
</div>
|
|
<style>
|
|
.bookmarks{color:var(--rs-text);font-family:var(--rs-font-ui)}.row{display:flex;align-items:center;padding:0 5px;border-radius:var(--rs-control-radius)}.row:hover{background:var(--rs-hover-bg)}
|
|
.link{display:flex;align-items:center;gap:8px;flex:1;min-width:0;padding:7px 5px;border:0;border-radius:var(--rs-control-radius);color:inherit;background:transparent;text-align:left;cursor:pointer}
|
|
span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.link:focus-visible{outline:2px solid var(--rs-focus)}p{padding:8px;font-size:12px}.error{color:var(--rs-error)}.note{margin:0;color:var(--rs-text-dim)}
|
|
</style>
|