HF / console /src /features /files-workspace /MemoryGraphView.module.less
mysticaldragon's picture
Deploy QwenPaw - Personal AI Assistant Platform
4e7644b
Raw History Blame Contribute Delete
14.7 kB
.graphView {
--graph-accent: var(
--qwenpaw-color-primary,
var(--ant-color-primary, #ff7f16)
);
--graph-accent-soft: var(
--qwenpaw-color-primary-bg,
var(--ant-color-primary-bg, #fff2e8)
);
--graph-on-accent: var(
--qwenpaw-color-text-light-solid,
var(--ant-color-text-light-solid, #fff)
);
--graph-success: var(
--qwenpaw-color-success-text,
var(--ant-color-success-text, #389e5c)
);
--graph-success-soft: var(
--qwenpaw-color-success-bg,
var(--ant-color-success-bg, #eef8f1)
);
--graph-warning: var(
--qwenpaw-color-warning-text,
var(--ant-color-warning-text, #d89614)
);
--graph-warning-soft: var(
--qwenpaw-color-warning-bg,
var(--ant-color-warning-bg, #fff8e6)
);
--graph-3d-surface: var(
--qwenpaw-color-bg-container,
var(--ant-color-bg-container, #fffdfb)
);
--graph-3d-root: var(
--qwenpaw-color-primary,
var(--ant-color-primary, #ff7f16)
);
--graph-3d-active: var(
--qwenpaw-color-primary-active,
var(--ant-color-primary-active, #d9650b)
);
--graph-3d-direct: var(
--qwenpaw-color-success-text,
var(--ant-color-success-text, #389e5c)
);
--graph-3d-hover: var(
--qwenpaw-color-primary-hover,
var(--ant-color-primary-hover, #ff9a45)
);
--graph-3d-file: var(
--qwenpaw-color-text-secondary,
var(--ant-color-text-secondary, #71665e)
);
--graph-3d-muted: var(
--qwenpaw-color-text-quaternary,
var(--ant-color-text-quaternary, #c7bfb8)
);
--graph-3d-edge: var(
--qwenpaw-color-border,
var(--ant-color-border, #d8cec6)
);
--graph-3d-edge-active: var(
--qwenpaw-color-primary-active,
var(--ant-color-primary-active, #d9650b)
);
--graph-3d-edge-muted: var(
--qwenpaw-color-border-secondary,
var(--ant-color-border-secondary, #eee7e1)
);
--graph-3d-label: var(--qwenpaw-color-text, var(--ant-color-text, #292522));
--graph-3d-label-background: var(
--qwenpaw-color-bg-elevated,
var(--ant-color-bg-elevated, #fffdfb)
);
--graph-3d-label-border: var(
--qwenpaw-color-primary-border,
var(--ant-color-primary-border, #ffc58f)
);
--graph-3d-ambient-light: var(
--qwenpaw-color-fill-secondary,
var(--ant-color-fill-secondary, #eee7e1)
);
--graph-3d-key-light: var(
--qwenpaw-color-bg-container,
var(--ant-color-bg-container, #fffdfb)
);
--graph-3d-fill-light: var(
--qwenpaw-color-primary-bg,
var(--ant-color-primary-bg, #fff2e8)
);
--graph-panel: var(
--qwenpaw-color-bg-container,
var(--ant-color-bg-container, var(--files-panel))
);
--graph-border: var(
--qwenpaw-color-border-secondary,
var(--ant-color-border-secondary, var(--files-line))
);
height: 100%;
min-height: 0;
display: flex;
flex-direction: column;
color: var(--files-ink);
background: var(--files-bg);
}
.toolbar {
min-height: 58px;
padding: 9px 14px 9px 20px;
display: flex;
flex: 0 0 auto;
align-items: center;
justify-content: space-between;
gap: 16px;
border-bottom: 1px solid var(--graph-border);
background: color-mix(in srgb, var(--graph-panel) 86%, var(--files-bg));
> div:first-child {
min-width: 0;
display: grid;
gap: 2px;
}
strong {
overflow: hidden;
font-size: 14px;
font-weight: 680;
letter-spacing: 0;
text-overflow: ellipsis;
white-space: nowrap;
}
span {
color: var(--files-muted);
font-size: 11px;
letter-spacing: 0;
}
}
.toolbarActions {
padding: 3px;
display: flex;
flex: 0 0 auto;
gap: 2px;
border: 1px solid var(--graph-border);
border-radius: 8px;
background: color-mix(in srgb, var(--files-panel) 82%, var(--files-bg));
button {
width: 32px;
height: 32px;
padding: 0;
display: grid;
place-items: center;
color: var(--files-muted);
border: 0;
border-radius: 6px;
background: transparent;
cursor: pointer;
transition:
color 160ms ease,
background 160ms ease,
transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
&:hover:not(:disabled) {
color: var(--graph-accent);
background: var(--graph-accent-soft);
transform: translateY(-1px);
}
&:focus-visible {
outline: 2px solid
color-mix(in srgb, var(--graph-accent) 42%, transparent);
outline-offset: 1px;
}
&:disabled {
cursor: not-allowed;
opacity: 0.42;
}
}
.actionActive {
color: var(--graph-accent);
background: var(--graph-accent-soft);
}
}
.content {
position: relative;
min-height: 0;
flex: 1;
display: grid;
grid-template-columns: minmax(0, 1fr);
}
.contentWithDetails {
grid-template-columns: minmax(0, 1fr) clamp(230px, 22%, 300px);
}
.canvas {
position: relative;
min-width: 0;
min-height: 0;
overflow: hidden;
isolation: isolate;
background: var(--graph-3d-surface);
&::after {
position: absolute;
inset: 0;
z-index: 2;
pointer-events: none;
box-shadow:
inset 0 0 0 1px color-mix(in srgb, var(--files-line) 42%, transparent),
inset 0 24px 64px color-mix(in srgb, var(--files-bg) 22%, transparent);
content: "";
}
}
.scene {
position: absolute;
inset: 0;
z-index: 1;
canvas {
width: 100%;
height: 100%;
display: block;
touch-action: none;
&:active {
cursor: grabbing;
}
}
}
.canvasState {
position: absolute;
inset: 0;
z-index: 4;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
color: var(--files-muted);
background: color-mix(in srgb, var(--graph-3d-surface) 94%, transparent);
font-size: 12px;
button {
margin-left: 4px;
padding: 6px 10px;
color: var(--graph-accent);
border: 1px solid var(--files-line);
border-radius: 6px;
background: var(--files-bg);
cursor: pointer;
}
}
.legend {
position: absolute;
left: 14px;
bottom: 12px;
z-index: 5;
min-height: 34px;
padding: 7px 10px;
display: flex;
align-items: center;
gap: 13px;
border: 1px solid var(--graph-border);
border-radius: 8px;
background: color-mix(in srgb, var(--graph-panel) 88%, transparent);
color: var(--files-muted);
font-size: 10px;
backdrop-filter: blur(12px);
box-shadow: 0 6px 18px rgba(37, 43, 40, 0.06);
span {
display: inline-flex;
align-items: center;
gap: 5px;
white-space: nowrap;
}
i {
width: 9px;
height: 9px;
display: inline-block;
border: 1.5px solid var(--graph-3d-file);
border-radius: 50%;
background: var(--graph-3d-file);
&[data-kind="root"] {
border-color: var(--graph-3d-root);
background: var(--graph-3d-root);
}
&[data-kind="direct"] {
border-color: var(--graph-3d-direct);
background: var(--graph-3d-direct);
}
}
b {
color: var(--graph-3d-edge);
font-size: 13px;
font-weight: 600;
}
}
.accessibleNodes {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
overflow: hidden;
clip: rect(0 0 0 0);
clip-path: inset(50%);
white-space: nowrap;
&:focus-within {
top: 12px;
left: 12px;
z-index: 7;
width: min(240px, calc(100% - 24px));
height: auto;
max-height: calc(100% - 66px);
padding: 8px;
display: grid;
gap: 4px;
overflow: auto;
clip: auto;
clip-path: none;
border: 1px solid var(--graph-border);
border-radius: 8px;
background: var(--graph-panel);
box-shadow: 0 12px 30px rgba(37, 43, 40, 0.14);
white-space: normal;
}
button {
min-height: 34px;
padding: 7px 9px;
overflow: hidden;
color: var(--files-ink);
border: 1px solid transparent;
border-radius: 6px;
background: var(--files-bg);
cursor: pointer;
font-size: 11px;
text-align: left;
text-overflow: ellipsis;
white-space: nowrap;
&:focus-visible {
border-color: var(--graph-accent);
outline: 2px solid
color-mix(in srgb, var(--graph-accent) 28%, transparent);
outline-offset: 1px;
}
}
}
.details {
min-width: 0;
padding: 18px 17px 22px;
overflow: auto;
border-left: 1px solid var(--graph-border);
background: color-mix(
in srgb,
var(--graph-panel) 92%,
var(--graph-3d-surface)
);
box-shadow: -12px 0 32px rgba(37, 43, 40, 0.045);
animation: details-in 170ms ease-out;
h2 {
margin: 12px 0 5px;
overflow-wrap: anywhere;
font-size: 16px;
font-weight: 680;
letter-spacing: 0;
line-height: 1.35;
}
> code {
display: block;
color: var(--files-muted);
font-size: 10px;
line-height: 1.5;
overflow-wrap: anywhere;
}
> p {
margin: 15px 0 0;
color: color-mix(in srgb, var(--files-ink) 76%, var(--files-muted));
font-size: 12px;
line-height: 1.65;
}
}
.detailsHeader {
min-height: 28px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
button {
width: 28px;
height: 28px;
padding: 0;
display: grid;
flex: 0 0 auto;
place-items: center;
color: var(--files-muted);
border: 1px solid transparent;
border-radius: 6px;
background: transparent;
cursor: pointer;
&:hover {
color: var(--files-ink);
border-color: var(--files-line);
background: var(--files-bg);
}
&:focus-visible {
outline: 2px solid
color-mix(in srgb, var(--graph-accent) 38%, transparent);
outline-offset: 1px;
}
}
}
.nodeStatus {
width: fit-content;
padding: 3px 7px;
color: var(--graph-success);
border-radius: 999px;
background: var(--graph-success-soft);
font-size: 10px;
font-weight: 650;
&[data-indexed="false"] {
color: var(--graph-warning);
background: var(--graph-warning-soft);
}
&[data-virtual="true"] {
color: var(--graph-accent);
background: var(--graph-accent-soft);
}
}
.openFileButton {
width: 100%;
min-height: 36px;
margin-top: 16px;
padding: 8px 10px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
color: var(--graph-accent);
border: 1px solid
color-mix(in srgb, var(--graph-accent) 28%, var(--graph-border));
border-radius: 7px;
background: var(--graph-accent-soft);
font-size: 11px;
font-weight: 650;
cursor: pointer;
transition:
color 160ms ease,
border-color 160ms ease,
background 160ms ease,
transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
&:hover {
color: var(--graph-on-accent);
border-color: var(--graph-accent);
background: var(--graph-accent);
transform: translateY(-1px);
}
&:focus-visible {
outline: 2px solid color-mix(in srgb, var(--graph-accent) 40%, transparent);
outline-offset: 2px;
}
}
.linkSection {
margin-top: 20px;
display: grid;
gap: 5px;
> strong {
margin-bottom: 2px;
color: var(--files-muted);
font-size: 10px;
font-weight: 700;
letter-spacing: 0;
}
button {
min-width: 0;
min-height: 34px;
padding: 7px 8px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 6px;
color: var(--files-ink);
border: 1px solid transparent;
border-radius: 6px;
background: color-mix(in srgb, var(--files-bg) 72%, transparent);
cursor: pointer;
text-align: left;
&:hover {
border-color: var(--files-line);
background: var(--files-bg);
}
&:focus-visible {
outline: 2px solid
color-mix(in srgb, var(--graph-accent) 34%, transparent);
outline-offset: 1px;
}
span {
min-width: 0;
overflow: hidden;
font-size: 11px;
text-overflow: ellipsis;
white-space: nowrap;
}
small {
flex: 0 0 auto;
color: var(--graph-accent);
font-size: 10px;
}
}
}
.state {
min-height: 220px;
flex: 1;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
color: var(--files-muted);
background: var(--files-bg);
font-size: 12px;
button {
margin-left: 4px;
padding: 6px 10px;
color: var(--graph-accent);
border: 1px solid var(--files-line);
border-radius: 6px;
background: var(--files-bg);
cursor: pointer;
}
}
.spin {
animation: graph-spin 900ms linear infinite;
}
:global(.dark-mode) {
.graphView {
--graph-3d-surface: var(--files-bg);
--graph-3d-root: var(--files-accent);
--graph-3d-active: #ffbc82;
--graph-3d-direct: #8bd5bd;
--graph-3d-hover: #ffd2ac;
--graph-3d-file: var(--files-muted);
--graph-3d-muted: var(--files-line);
--graph-3d-edge: #b7a299;
--graph-3d-edge-active: var(--files-accent);
--graph-3d-edge-muted: var(--files-line);
--graph-3d-label: var(--files-ink);
--graph-3d-label-background: var(--files-panel);
--graph-3d-label-border: #7f5d49;
--graph-3d-ambient-light: var(--files-ink);
--graph-3d-key-light: var(--files-ink);
--graph-3d-fill-light: var(--files-accent);
--graph-panel: var(--files-panel);
--graph-border: var(--files-line);
}
}
@media (max-width: 720px) {
.contentWithDetails {
grid-template-columns: 1fr;
}
.details {
position: absolute;
right: 10px;
bottom: 10px;
z-index: 8;
width: min(280px, calc(100% - 20px));
max-height: 48%;
border: 1px solid var(--files-line);
border-radius: 8px;
box-shadow: 0 12px 32px rgba(37, 43, 40, 0.14);
}
}
@media (max-width: 560px) {
.toolbar {
min-height: 98px;
padding: 8px 10px 8px 13px;
flex-direction: column;
align-items: stretch;
gap: 8px;
}
.toolbarActions {
width: fit-content;
padding: 2px;
align-self: flex-end;
display: grid;
grid-template-columns: repeat(3, auto);
gap: 1px;
button {
width: 30px;
height: 30px;
}
}
.legend {
left: 10px;
bottom: 10px;
max-width: calc(100% - 20px);
flex-wrap: wrap;
gap: 5px 9px;
span:nth-child(3) {
display: none;
}
}
.details {
position: fixed;
right: 10px;
bottom: 10px;
left: 10px;
width: auto;
max-height: min(58vh, 440px);
}
}
@media (pointer: coarse) {
.toolbarActions button {
width: 44px;
height: 44px;
}
.detailsHeader button,
.linkSection button,
.openFileButton,
.accessibleNodes button {
min-height: 44px;
}
}
@media (prefers-reduced-motion: reduce) {
.details,
.toolbarActions button,
.openFileButton {
transition: none;
animation: none;
}
.spin {
animation-duration: 1500ms;
}
}
@keyframes graph-spin {
to {
transform: rotate(360deg);
}
}
@keyframes details-in {
from {
opacity: 0;
transform: translateX(8px);
}
}