fix(elements): delay hiding sidebar and properties panels during native-mode transition and use transparent rgba border for frame to avoid layout jumps

This commit is contained in:
2026-01-04 11:43:54 +00:00
parent 8c60d3bea3
commit 28d1227d30
5 changed files with 47 additions and 6 deletions

View File

@@ -1,5 +1,12 @@
# Changelog
## 2026-01-04 - 3.5.2 - fix(elements)
delay hiding sidebar and properties panels during native-mode transition and use transparent rgba border for frame to avoid layout jumps
- Add isHidden state to wcc-sidebar and wcc-properties and switch display bindings to use isHidden instead of directly using isNative
- Introduce a 300ms delayed hide when entering native mode so UI hides after frame animation completes; show immediately when exiting native mode
- Replace hardcoded hex border values in wcc-frame with rgba and set native border to a transparent 0px to prevent abrupt visual jumps
## 2026-01-04 - 3.5.1 - fix(sidebar)
disable frame CSS transition while user is resizing the sidebar to prevent janky animations

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@design.estate/dees-wcctools',
version: '3.5.1',
version: '3.5.2',
description: 'A set of web component tools for creating element catalogues, enabling the structured development and documentation of custom elements and pages.'
}

View File

@@ -28,7 +28,7 @@ export class WccFrame extends DeesElement {
public static styles = [
css`
:host {
border: 10px solid #ffaeaf;
border: 10px solid rgba(255, 174, 175, 1);
position: absolute;
background: ${cssManager.bdTheme('#333', '#000')};
right: 0px;
@@ -52,14 +52,14 @@ export class WccFrame extends DeesElement {
<style>
:host {
${this.isNative ? `
border: none !important;
border: 0px solid rgba(255, 174, 175, 0) !important;
left: 0px !important;
right: 0px !important;
top: 0px !important;
bottom: 0px !important;
` : `
bottom: ${this.advancedEditorOpen ? '400px' : '100px'};
border: 10px solid #ffaeaf;
border: 10px solid rgba(255, 174, 175, 1);
left: ${this.sidebarWidth}px;
`}
transition: ${this.isResizing ? 'none' : 'all 0.3s ease'};

View File

@@ -63,6 +63,10 @@ export class WccProperties extends DeesElement {
@state()
accessor recordingDuration: number = 0;
// Delayed hide for native mode transition
@state()
accessor isHidden: boolean = false;
public editorHeight: number = 300;
public render(): TemplateResult {
@@ -99,7 +103,7 @@ export class WccProperties extends DeesElement {
overflow: hidden;
background: var(--background);
color: var(--foreground);
display: ${this.isNative ? 'none' : 'block'};
display: ${this.isHidden ? 'none' : 'block'};
}
.grid {
display: grid;
@@ -931,6 +935,19 @@ export class WccProperties extends DeesElement {
protected updated(changedProperties: Map<string, unknown>) {
super.updated(changedProperties);
// Handle delayed hide for native mode transition
if (changedProperties.has('isNative')) {
if (this.isNative) {
// Delay hiding until frame animation completes
setTimeout(() => {
this.isHidden = true;
}, 300);
} else {
// Show immediately when exiting native mode
this.isHidden = false;
}
}
// Only recreate properties when selectedItem changes
if (changedProperties.has('selectedItem')) {
this.createProperties().catch(error => {

View File

@@ -44,6 +44,10 @@ export class WccSidebar extends DeesElement {
@state()
accessor isResizing: boolean = false;
// Delayed hide for native mode transition
@state()
accessor isHidden: boolean = false;
private sectionsInitialized = false;
public render(): TemplateResult {
@@ -67,7 +71,7 @@ export class WccSidebar extends DeesElement {
--ring: #3b82f6;
--radius: 4px;
display: ${this.isNative ? 'none' : 'block'};
display: ${this.isHidden ? 'none' : 'block'};
border-right: 1px solid rgba(255, 255, 255, 0.08);
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
font-size: 14px;
@@ -732,6 +736,19 @@ export class WccSidebar extends DeesElement {
protected updated(changedProperties: Map<string, unknown>) {
super.updated(changedProperties);
// Handle delayed hide for native mode transition
if (changedProperties.has('isNative')) {
if (this.isNative) {
// Delay hiding until frame animation completes
setTimeout(() => {
this.isHidden = true;
}, 300);
} else {
// Show immediately when exiting native mode
this.isHidden = false;
}
}
// Auto-expand folder when a multi-demo element is selected
if (changedProperties.has('selectedItem') && this.selectedItem && this.dashboardRef?.sections) {
// Find the element in any section