Unify viewport glass and professional BIM controls

This commit is contained in:
Codex
2026-11-14 22:53:01 +03:00
parent 9a00d0bb06
commit d8ed37e09d
9 changed files with 51 additions and 18 deletions
+6 -4
View File
@@ -230,12 +230,12 @@ const iconGroups: Array<{ title: string; note: string; icons: IconName[] }> = [
{
title: "Редактирование",
note: "Launcher / SEO",
icons: ["save", "edit", "trash", "copy", "upload", "download", "external", "rotate-clockwise", "add-point", "ruler", "section", "isolate", "orthographic", "perspective", "select", "pen", "rectangle", "curve", "undo", "redo"],
icons: ["save", "edit", "trash", "copy", "upload", "download", "external", "rotate-clockwise", "add-point", "ruler", "section", "isolate", "orthographic", "perspective", "fit-view", "select", "pen", "rectangle", "curve", "undo", "redo"],
},
{
title: "Состояние и доступ",
note: "Вся платформа",
icons: ["check", "alert", "info", "activity", "lock", "key", "shield", "circle", "eye", "eye-off"],
icons: ["check", "alert", "info", "info-plain", "activity", "lock", "key", "shield", "circle", "eye", "eye-off"],
},
{
title: "Сущности",
@@ -283,6 +283,8 @@ const iconLabels: Record<IconName, string> = {
image: "Изображение",
inbox: "Уведомления",
info: "Информация",
"info-plain": "Информация без окружности",
"fit-view": "Вписать модель",
key: "Ключ",
layers: "Слои",
list: "Список задач",
@@ -1401,7 +1403,7 @@ export function CatalogApp() {
return (
<div className="catalog-grid">
<Preview title="Mission Core" note="canonical foundation / nested fields / portal" className="catalog-preview--wide"><MissionThemeExample/></Preview>
<Preview title="Navigation cube" note="faces / edges / corners"><NavigationCube edgeOpacity={cubeEdgeOpacity} size={cubeSize} quaternion={[.28,-.36,.12,.88]} onSelect={setCubeDirection}/><RangeControl label="Размер 3D-куба" value={cubeSize} min={48} max={160} step={1} onChange={setCubeSize} formatValue={v=>`${v} px`}/><RangeControl label="Прозрачность линий куба" value={1-cubeEdgeOpacity} min={0} max={1} step={.05} onChange={v=>setCubeEdgeOpacity(1-v)} formatValue={v=>`${Math.round(v*100)}%`}/><p>{cubeDirection.join(" · ")}</p></Preview>
<Preview title="Navigation cube" note="faces / edges / corners"><NavigationCube faceOpacity={.65} edgeOpacity={cubeEdgeOpacity} size={cubeSize} quaternion={[.28,-.36,.12,.88]} onSelect={setCubeDirection}/><RangeControl label="Размер 3D-куба" value={cubeSize} min={48} max={160} step={1} onChange={setCubeSize} formatValue={v=>`${v} px`}/><RangeControl label="Прозрачность линий куба" value={1-cubeEdgeOpacity} min={0} max={1} step={.05} onChange={v=>setCubeEdgeOpacity(1-v)} formatValue={v=>`${Math.round(v*100)}%`}/><p>{cubeDirection.join(" · ")}</p></Preview>
<Preview title="Selection" note="integrated / split / inline">
<div className="catalog-form">
<FieldFrame label="Hub / integrated select" labelPlacement="below">
@@ -2371,7 +2373,7 @@ export function CatalogApp() {
) : null}
<Window open={treeDemoOpen} title="Объекты сцены" placement="end" resizable draggable rect={treeDemoRect} onRectCommit={setTreeDemoRect} onClose={()=>setTreeDemoOpen(false)}>
<Tree defaultExpandedDepth={2} renderActions={node=><Dropdown width={320} trigger={({setTriggerRef,show,open})=><IconButton ref={setTriggerRef} label={`Информация: ${node.label}`} aria-expanded={open} onMouseEnter={show} onClick={show}><Icon name="info"/></IconButton>}><Description>{node.label}</Description></Dropdown>} label="Пример дерева объектов" selected={treeSelected} onSelect={setTreeSelected} onVisibilityChange={(_,visible)=>setTreeVisible(visible)} nodes={[{id:'scene',label:'Сцена',children:[{id:'model',label:'Модель',children:[{id:'cells',label:'Ячейки / внутренний блок',visible:treeVisible},{id:'panel',label:'Боковая панель корпуса / длинное название детали'}]}]}]}/>
<Tree defaultExpandedDepth={2} renderActions={node=><Dropdown width={320} trigger={({setTriggerRef,show,open})=><IconButton ref={setTriggerRef} label={`Информация: ${node.label}`} aria-expanded={open} onMouseEnter={show} onClick={show}><Icon name="info-plain" size={14}/></IconButton>}><Description>{node.label}</Description></Dropdown>} label="Пример дерева объектов" selected={treeSelected} onSelect={setTreeSelected} onVisibilityChange={(_,visible)=>setTreeVisible(visible)} nodes={[{id:'scene',label:'Сцена',children:[{id:'model',label:'Модель',children:[{id:'cells',label:'Ячейки / внутренний блок',visible:treeVisible},{id:'panel',label:'Боковая панель корпуса / длинное название детали'}]}]}]}/>
</Window>
<Window
open={inspectorOpen}
+3 -1
View File
@@ -569,9 +569,11 @@ The shared theme supports `edges: "flat"` for borderless surfaces, including por
`renderPathBar(target, items, {icon, onNavigate})` — компактная строка пути в стиле Finder: нейтральные иконки папок, текст и разделители `›`, без pill-кнопок. Подключается `@nodedc/ui-dom/styles.css`. Папки — клавиатурно доступные кнопки; конечный файл — текст с `aria-current`. Длинный путь прокручивается по горизонтали. Consumer передаёт пути и существующий Icon, хранение и навигация остаются в приложении. Живой пример: «Размер DOM-окна».
Toolbar `menuWidth` controls inspector menu width (default 220 px, bounded 180–600 px); Dropdown retains viewport clamping. Tree `renderActions(node)` supports per-item information menus without duplicating the outliner. `defaultExpandedDepth` limits initial expansion; selecting an item still reveals and scrolls to its ancestors. BIM uses canonical `ruler` (Ruler), `section` (Slice), and `isolate` (Focus) glyphs.
Toolbar `menuWidth` controls inspector menu width (default 220 px, bounded 180–600 px); Dropdown retains viewport clamping. Tree `renderActions(node)` supports per-item information menus without duplicating the outliner. `defaultExpandedDepth` limits initial expansion; selecting an item still reveals and scrolls to its ancestors. BIM uses canonical `ruler` (dimension line), `section` (model/plane), and `isolate` (temporary visibility) glyphs.
Open Dropdown surfaces observe content size changes and recompute their viewport bounds, including asynchronous property/volume results. Information triggers open on hover or explicit pointer/keyboard activation with `show`. Do not open on focus alone: Escape restores trigger focus and must keep the menu closed.
EditorDockLayout rounds only the external corners of its complete tiled area using the shared panel radius. A left stack has a rounded top-left on its first pane and bottom-left on its last; a bottom row has only the outer lower corners. Internal joins remain square. Corners recompute after docking, closing, resizing or restoring panels. Floating tools retain all four window corners. The primary viewport follows the same outside-edge rule.
Viewport-scoped Toolbar buttons use the same scene Glass V4 material as the top viewport controls, preserving pressed, disabled and keyboard states. Its rail remains transparent. Compact Tree information actions use `info-plain` at 14 px beside the existing eye.
+4
View File
@@ -51,3 +51,7 @@ hover, focus, disabled и pending принадлежат кнопке. `activity
`rotate-clockwise` — поворот изображения по часовой стрелке. Применение: независимая ориентация объективов Insta360 в Центре наблюдения Mission Core, по запросу владельца 09.10.2026. Шаг задаёт приложение; подпись кнопки сообщает угол. Состояния и геометрия принадлежат каноническому `IconButton`.
`power` — штатное выключение компьютера. Запрошено владельцем Mission Core 04.11.2026 для шапки окна «Бортовой компьютер». Используется в стандартном `IconButton` с доступной подписью; недоступность и выполняемое действие блокируют кнопку. Нажатие открывает `ConfirmationModal`; сам glyph не запускает выключение. Живой каталог получает иконку из `registry/icons.json`.
BIM controls use `ruler` (dimension line with extension lines/arrows), `section` (model intersected by a plane), `isolate` (temporary visibility/glasses), `perspective`/`orthographic` (projection cubes), and `fit-view` (frame extents). `info-plain` is an unframed i for compact tree actions next to the visibility eye; use 14 px for both glyphs. They share the canonical stroke and accessible control behavior.
Semantic references: [Revit measurement](https://help.autodesk.com/cloudhelp/2024/ENU/Revit-Model/files/GUID-65EA44EC-C777-4C97-8718-5783C3A80B0A.htm), [temporary hide/isolate](https://help.autodesk.com/cloudhelp/2014/ENU/Revit-LT/files/GUID-A5E51D5E-8E18-4834-8A2F-8B4E3E6379A1.htm), [section box](https://help.autodesk.com/cloudhelp/2024/ENU/Revit-GetStarted/files/GUID-C9EA51CB-3214-4BD8-AD55-3BEB1CCD15B6.htm). Glyphs are original monochrome NODE.DC vectors; this does not claim copied Autodesk artwork or full Section Box functionality.
+2
View File
@@ -11,3 +11,5 @@ Visible hit regions have native tooltips, hover, keyboard focus, Enter/Space act
Presentation props: `size` in CSS pixels (default 66), `face`, `text`, `edge`, `hover`, `hoverText`, `opacity`. Consumer preferences may persist these; omitted colors inherit theme tokens. Core exposes these under viewport settings → 3D-куб.
Face labels use the projected face-local right/up basis, including foreshortening and rotation; they never billboard towards the screen. `edgeOpacity` (0–1, default 1) independently controls structural grid/edge strokes without fading faces or labels.
`faceOpacity` (0–1, default 1) controls polygon fill only. It is independent of `edgeOpacity`, text and the legacy overall `opacity`; a transparent face remains a navigation target.
+6 -1
View File
@@ -4577,7 +4577,7 @@ textarea.nodedc-field__control {
/* Structural cube edges communicate face/edge/corner hit zones. */
.nodedc-navigation-cube { width: 66px; height: 66px; overflow: visible; user-select: none; }
.nodedc-navigation-cube polygon { fill: var(--cube-face, var(--nodedc-surface-raised, #292929)); stroke: var(--cube-edge, var(--nodedc-text-muted, #888)); stroke-width: .55; stroke-opacity: var(--cube-edge-opacity, 1); }
.nodedc-navigation-cube polygon { fill: var(--cube-face, var(--nodedc-surface-raised, #292929)); stroke: var(--cube-edge, var(--nodedc-text-muted, #888)); stroke-width: .55; stroke-opacity: var(--cube-edge-opacity, 1); fill-opacity:var(--cube-face-opacity,1); }
.nodedc-navigation-cube text { fill: var(--cube-text, var(--nodedc-text-primary, #eee)); font: 600 9px var(--nodedc-font-family); pointer-events: none; }
.nodedc-navigation-cube g { cursor: pointer; }
.nodedc-navigation-cube g.is-hovered polygon, .nodedc-navigation-cube g:focus-visible polygon { fill: var(--cube-hover, var(--nodedc-control-selected-bg, #eee)); }
@@ -4734,6 +4734,7 @@ textarea.nodedc-field__control {
/* Owner canon 2026-11-14: all viewport-backed UI shares scene Glass V4.
Geometry, disabled opacity, pressed selection and keyboard focus are retained.
The DOM surface class is for existing semantic overlays, never the renderer. */
.nodedc-toolbar-wrap[data-scope="viewport"] .nodedc-toolbar__button:not([data-active="true"]),
.nodedc-viewport-surface[data-glass-context="scene"],
:is(.nodedc-viewport-controls, .nodedc-scene-controls) :is(.nodedc-icon-button:not([aria-pressed="true"]), .nodedc-button:is([data-variant="secondary"], [data-variant="ghost"]):not([aria-pressed="true"]), .nodedc-select__toggle, .nodedc-segmented, .nodedc-workspace-window__action:not([aria-pressed="true"])) {
background: rgb(var(--nodedc-modal-glass-tint-rgb) / var(--nodedc-scene-glass-opacity));
@@ -4741,9 +4742,13 @@ textarea.nodedc-field__control {
backdrop-filter: blur(var(--nodedc-scene-glass-blur)) saturate(var(--nodedc-modal-glass-saturation)) brightness(var(--nodedc-modal-glass-brightness));
-webkit-backdrop-filter: blur(var(--nodedc-scene-glass-blur)) saturate(var(--nodedc-modal-glass-saturation)) brightness(var(--nodedc-modal-glass-brightness));
}
.nodedc-toolbar-wrap[data-scope="viewport"] .nodedc-toolbar__button:hover:not(:disabled):not([data-active="true"]),
:is(.nodedc-viewport-controls, .nodedc-scene-controls) :is(.nodedc-icon-button, .nodedc-button:is([data-variant="secondary"], [data-variant="ghost"]), .nodedc-workspace-window__action):hover:not(:disabled):not([aria-pressed="true"]) {
background: color-mix(in srgb, var(--nodedc-text-primary) 12%, rgb(var(--nodedc-modal-glass-tint-rgb) / var(--nodedc-scene-glass-opacity)));
}
.nodedc-tree__actions {display:flex;flex:none;align-items:center;}
.nodedc-tree__actions .nodedc-icon-button {flex:0 0 24px;width:24px;height:24px;min-width:24px;padding:0;}
/* A backdrop root on the transparent rail would prevent button glass sampling the scene. */
.nodedc-toolbar-wrap[data-scope="viewport"] .nodedc-toolbar {will-change:transform;}
+21 -8
View File
@@ -1,8 +1,8 @@
import {
MousePointer2,
Ruler,
Slice,
Focus,
createLucideIcon,
Glasses,
Cuboid,
Move,
CirclePlus,
Box,
@@ -73,13 +73,25 @@ import {
type LucideProps,
} from "lucide-react";
// CAD vocabulary: dimension line, cutting plane and unframed information glyph.
const DimensionLine = createLucideIcon('DimensionLine', [
['path', {d:'M4 5v14M20 5v14M4 12h16M8 9l-4 3 4 3M16 9l4 3-4 3',key:'dimension'}],
]);
const SectionPlane = createLucideIcon('SectionPlane', [
['path', {d:'m5 7 7-4 7 4v10l-7 4-7-4V7m0 0 7 4 7-4M12 11v10',key:'model'}],
['path', {d:'m2 12 10-5 10 5-10 5-10-5Z',key:'plane'}],
]);
const InformationPlain = createLucideIcon('InformationPlain', [
['path', {d:'M12 4h.01M10 9h2v11M9 20h6',key:'information'}],
]);
const icons = {
"add-point": CirclePlus,
ruler: Ruler,
section: Slice,
isolate: Focus,
perspective: Box,
orthographic: Scan,
ruler: DimensionLine,
section: SectionPlane,
isolate: Glasses,
perspective: Cuboid,
orthographic: Box,
"fit-view": Scan,
select: MousePointer2,
move: Move,
pen: PenTool,
@@ -116,6 +128,7 @@ const icons = {
image: Image,
inbox: Inbox,
info: Info,
"info-plain": InformationPlain,
key: KeyRound,
layers: Layers,
list: ListChecks,
+3 -3
View File
@@ -4,7 +4,7 @@ export interface NavigationCubeProps {
/** Camera world quaternion, Y up. Directions point from target toward camera. */
quaternion: readonly [number,number,number,number];
onSelect: (direction:CubeDirection)=>void;
size?:number; face?:string; text?:string; edge?:string; hover?:string; hoverText?:string; opacity?:number; edgeOpacity?:number;
size?:number; face?:string; text?:string; edge?:string; hover?:string; hoverText?:string; opacity?:number; edgeOpacity?:number; faceOpacity?:number;
disabled?:boolean;
label?:string;
}
@@ -42,9 +42,9 @@ export function cubeRegions(quaternion:NavigationCubeProps["quaternion"]) {
});
}
/** BIM-style face / edge / corner navigation, independent of the scene engine. */
export function NavigationCube({quaternion,onSelect,disabled=false,label="Навигационный куб",size=66,face,text,edge,hover:highlight,hoverText,opacity=1,edgeOpacity=1}:NavigationCubeProps) {
export function NavigationCube({quaternion,onSelect,disabled=false,label="Навигационный куб",size=66,face,text,edge,hover:highlight,hoverText,opacity=1,edgeOpacity=1,faceOpacity=1}:NavigationCubeProps) {
const [hover,setHover]=useState<string|null>(null);
return <svg className="nodedc-navigation-cube" style={{width:size,height:size,opacity,"--cube-face":face,"--cube-text":text,"--cube-edge":edge,"--cube-edge-opacity":edgeOpacity,"--cube-hover":highlight,"--cube-hover-text":hoverText} as CSSProperties} viewBox="0 0 120 120" role="group" aria-label={label}>
return <svg className="nodedc-navigation-cube" style={{width:size,height:size,opacity,"--cube-face":face,"--cube-face-opacity":faceOpacity,"--cube-text":text,"--cube-edge":edge,"--cube-edge-opacity":edgeOpacity,"--cube-hover":highlight,"--cube-hover-text":hoverText} as CSSProperties} viewBox="0 0 120 120" role="group" aria-label={label}>
{cubeRegions(quaternion).map(r=><g key={r.id} role="button" aria-label={`Ракурс: ${r.label}`} aria-disabled={disabled}
tabIndex={disabled?-1:0} className={hover===r.label?"is-hovered":""}
onPointerEnter={()=>setHover(r.label)} onPointerLeave={()=>setHover(null)}
+4 -1
View File
@@ -814,6 +814,7 @@
"viewport container scope with local edge reveal",
"native tooltips with keyboard shortcut hints",
"optional canonical dropdown for toolbar item menus",
"viewport-scoped buttons share scene Glass V4; the rail stays transparent",
"bounded menuWidth for rich inspectors; default remains 220 px",
"theme-independent geometry",
"menus outside maximum magnified icon envelope",
@@ -1268,6 +1269,7 @@
],
"summary": "Renderer-independent BIM-style orientation cube; six faces, twelve edges, eight corners.",
"behavior": [
"independent faceOpacity, edgeOpacity and text colors; overall opacity remains compatible",
"Tracks camera quaternion; never changes projection implicitly",
"Visible regions support hover, focus, Enter/Space and disabled state",
"Consumer owns camera navigation and coordinate conversion",
@@ -1300,7 +1302,8 @@
],
"rules": [
"Use for object hierarchies; no nested ResourceRow cards.",
"Host owns model identity and visibility; the tree owns navigation presentation."
"Host owns model identity and visibility; the tree owns navigation presentation.",
"Compact information uses info-plain at 14px beside the independent visibility eye."
]
},
{
+2
View File
@@ -54,6 +54,7 @@
"sliders",
"search",
"orthographic",
"fit-view",
"perspective"
]
},
@@ -97,6 +98,7 @@
"check",
"alert",
"info",
"info-plain",
"activity",
"lock",
"key",