mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
fix(dsh-plugin-browserskill): dock below the shell top bar
The plain top:16 default overlapped the shell's Session log action; dock the card and capsule at the content area's top-right (64px) so neither collides with the header controls.
This commit is contained in:
1 parent
47070fdc14
commit
b07b8fec65
2 files changed
+5
-3
No files matched your search
@@ -182,7 +182,7 @@
|
|||||||
.capsule {
|
.capsule {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
right: 16px;
|
right: 16px;
|
||||||
top: 16px;
|
top: 64px;
|
||||||
z-index: 40;
|
z-index: 40;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ interface Size {
|
|||||||
const DEFAULT_SIZE: Size = { w: 320, h: 240 };
|
const DEFAULT_SIZE: Size = { w: 320, h: 240 };
|
||||||
const MIN_SIZE: Size = { w: 240, h: 180 };
|
const MIN_SIZE: Size = { w: 240, h: 180 };
|
||||||
const EDGE_MARGIN = 16;
|
const EDGE_MARGIN = 16;
|
||||||
|
/** Default dock: top-right, just under the shell's top bar (no spacing tokens exist in dsh 0.1). */
|
||||||
|
const TOP_OFFSET = 64;
|
||||||
|
|
||||||
function pipApi(): DocumentPip | undefined {
|
function pipApi(): DocumentPip | undefined {
|
||||||
if (typeof window === "undefined") return undefined;
|
if (typeof window === "undefined") return undefined;
|
||||||
@@ -408,7 +410,7 @@ export function ObservationOverlay({ store }: { store: ObservationClientStore })
|
|||||||
)?.getBoundingClientRect();
|
)?.getBoundingClientRect();
|
||||||
const base = {
|
const base = {
|
||||||
x: rect?.left ?? pos?.x ?? viewport().w - size.w - EDGE_MARGIN,
|
x: rect?.left ?? pos?.x ?? viewport().w - size.w - EDGE_MARGIN,
|
||||||
y: rect?.top ?? pos?.y ?? EDGE_MARGIN,
|
y: rect?.top ?? pos?.y ?? TOP_OFFSET,
|
||||||
w: rect?.width ?? size.w,
|
w: rect?.width ?? size.w,
|
||||||
h: rect?.height ?? size.h,
|
h: rect?.height ?? size.h,
|
||||||
};
|
};
|
||||||
@@ -474,7 +476,7 @@ export function ObservationOverlay({ store }: { store: ObservationClientStore })
|
|||||||
const style: React.CSSProperties =
|
const style: React.CSSProperties =
|
||||||
pos !== null
|
pos !== null
|
||||||
? { left: pos.x, top: pos.y, width: size.w, height: size.h }
|
? { left: pos.x, top: pos.y, width: size.w, height: size.h }
|
||||||
: { right: EDGE_MARGIN, top: EDGE_MARGIN, width: size.w, height: size.h };
|
: { right: EDGE_MARGIN, top: TOP_OFFSET, width: size.w, height: size.h };
|
||||||
return (
|
return (
|
||||||
<div className={css.card} style={style} data-obs-card data-testid="obs-card">
|
<div className={css.card} style={style} data-obs-card data-testid="obs-card">
|
||||||
{body}
|
{body}
|
||||||
|
|||||||
Reference in new issue
Block a user