fix(frontend): opened policy rule stays in view while its card grows, chevrons hold one column, switch and field sizes match the rest

This commit is contained in:
hh committed 2026-10-14 04:31:18 +02:00
1 parent dfc726976b
commit 0362777a51
2 files changed
+37 -9

No files matched your search

@@ -509,10 +509,10 @@
flex-shrink: 0;
align-items: center;
width: 2.125rem;
height: 1.25rem;
width: 2.25rem;
height: 1.375rem;
padding: 0.125rem;
border-radius: 0.625rem;
border-radius: 0.6875rem;
background-color: var(--color-borders-input);
@@ -524,8 +524,8 @@
}
.knob {
width: 1rem;
height: 1rem;
width: 1.125rem;
height: 1.125rem;
border-radius: 50%;
background-color: var(--color-white);
@@ -107,9 +107,11 @@
}
function reveal(node: HTMLElement) {
requestAnimationFrame(() => {
const observer = new ResizeObserver(() => {
node.parentElement?.scrollIntoView({ block: "nearest" });
});
observer.observe(node);
return () => observer.disconnect();
}
function draftBefore(rule: PolicyRule): boolean {
@@ -237,13 +239,21 @@
</span>
{/if}
</span>
<Icon name={open ? "up" : "down"} size="1.125rem" />
</button>
{#if extra}
<Button onclick={() => drop(rule)} smaller variant="text">
Убрать
</Button>
{/if}
<button
aria-hidden="true"
class="chevron"
onclick={() => toggle(rule)}
tabindex="-1"
type="button"
>
<Icon name={open ? "up" : "down"} size="1.125rem" />
</button>
</div>
{#if open}
<div class="editor" {@attach reveal}>
@@ -474,7 +484,7 @@
.line {
display: flex;
align-items: center;
padding-right: 0.5rem;
padding-right: 0.375rem;
}
.main {
@@ -516,6 +526,24 @@
}
}
.chevron {
cursor: pointer;
display: flex;
flex-shrink: 0;
align-items: center;
justify-content: center;
width: 2rem;
height: 2.5rem;
padding: 0;
border: 0;
color: var(--color-text-secondary);
background: none;
}
.glyph {
display: flex;
flex-shrink: 0;
@@ -619,7 +647,7 @@
margin: 0.25rem 0.5rem 0.5rem;
padding: 0.5rem 0.75rem;
border: 1px solid var(--color-borders);
border-radius: var(--border-radius-default-small);
border-radius: var(--border-radius-default);
font: inherit;
font-size: 0.9375rem;