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:
@@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# 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)
|
## 2026-01-04 - 3.5.1 - fix(sidebar)
|
||||||
disable frame CSS transition while user is resizing the sidebar to prevent janky animations
|
disable frame CSS transition while user is resizing the sidebar to prevent janky animations
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@design.estate/dees-wcctools',
|
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.'
|
description: 'A set of web component tools for creating element catalogues, enabling the structured development and documentation of custom elements and pages.'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export class WccFrame extends DeesElement {
|
|||||||
public static styles = [
|
public static styles = [
|
||||||
css`
|
css`
|
||||||
:host {
|
:host {
|
||||||
border: 10px solid #ffaeaf;
|
border: 10px solid rgba(255, 174, 175, 1);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background: ${cssManager.bdTheme('#333', '#000')};
|
background: ${cssManager.bdTheme('#333', '#000')};
|
||||||
right: 0px;
|
right: 0px;
|
||||||
@@ -52,14 +52,14 @@ export class WccFrame extends DeesElement {
|
|||||||
<style>
|
<style>
|
||||||
:host {
|
:host {
|
||||||
${this.isNative ? `
|
${this.isNative ? `
|
||||||
border: none !important;
|
border: 0px solid rgba(255, 174, 175, 0) !important;
|
||||||
left: 0px !important;
|
left: 0px !important;
|
||||||
right: 0px !important;
|
right: 0px !important;
|
||||||
top: 0px !important;
|
top: 0px !important;
|
||||||
bottom: 0px !important;
|
bottom: 0px !important;
|
||||||
` : `
|
` : `
|
||||||
bottom: ${this.advancedEditorOpen ? '400px' : '100px'};
|
bottom: ${this.advancedEditorOpen ? '400px' : '100px'};
|
||||||
border: 10px solid #ffaeaf;
|
border: 10px solid rgba(255, 174, 175, 1);
|
||||||
left: ${this.sidebarWidth}px;
|
left: ${this.sidebarWidth}px;
|
||||||
`}
|
`}
|
||||||
transition: ${this.isResizing ? 'none' : 'all 0.3s ease'};
|
transition: ${this.isResizing ? 'none' : 'all 0.3s ease'};
|
||||||
|
|||||||
@@ -63,6 +63,10 @@ export class WccProperties extends DeesElement {
|
|||||||
@state()
|
@state()
|
||||||
accessor recordingDuration: number = 0;
|
accessor recordingDuration: number = 0;
|
||||||
|
|
||||||
|
// Delayed hide for native mode transition
|
||||||
|
@state()
|
||||||
|
accessor isHidden: boolean = false;
|
||||||
|
|
||||||
public editorHeight: number = 300;
|
public editorHeight: number = 300;
|
||||||
|
|
||||||
public render(): TemplateResult {
|
public render(): TemplateResult {
|
||||||
@@ -99,7 +103,7 @@ export class WccProperties extends DeesElement {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: var(--background);
|
background: var(--background);
|
||||||
color: var(--foreground);
|
color: var(--foreground);
|
||||||
display: ${this.isNative ? 'none' : 'block'};
|
display: ${this.isHidden ? 'none' : 'block'};
|
||||||
}
|
}
|
||||||
.grid {
|
.grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
@@ -931,6 +935,19 @@ export class WccProperties extends DeesElement {
|
|||||||
protected updated(changedProperties: Map<string, unknown>) {
|
protected updated(changedProperties: Map<string, unknown>) {
|
||||||
super.updated(changedProperties);
|
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
|
// Only recreate properties when selectedItem changes
|
||||||
if (changedProperties.has('selectedItem')) {
|
if (changedProperties.has('selectedItem')) {
|
||||||
this.createProperties().catch(error => {
|
this.createProperties().catch(error => {
|
||||||
|
|||||||
@@ -44,6 +44,10 @@ export class WccSidebar extends DeesElement {
|
|||||||
@state()
|
@state()
|
||||||
accessor isResizing: boolean = false;
|
accessor isResizing: boolean = false;
|
||||||
|
|
||||||
|
// Delayed hide for native mode transition
|
||||||
|
@state()
|
||||||
|
accessor isHidden: boolean = false;
|
||||||
|
|
||||||
private sectionsInitialized = false;
|
private sectionsInitialized = false;
|
||||||
|
|
||||||
public render(): TemplateResult {
|
public render(): TemplateResult {
|
||||||
@@ -67,7 +71,7 @@ export class WccSidebar extends DeesElement {
|
|||||||
--ring: #3b82f6;
|
--ring: #3b82f6;
|
||||||
--radius: 4px;
|
--radius: 4px;
|
||||||
|
|
||||||
display: ${this.isNative ? 'none' : 'block'};
|
display: ${this.isHidden ? 'none' : 'block'};
|
||||||
border-right: 1px solid rgba(255, 255, 255, 0.08);
|
border-right: 1px solid rgba(255, 255, 255, 0.08);
|
||||||
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@@ -732,6 +736,19 @@ export class WccSidebar extends DeesElement {
|
|||||||
protected updated(changedProperties: Map<string, unknown>) {
|
protected updated(changedProperties: Map<string, unknown>) {
|
||||||
super.updated(changedProperties);
|
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
|
// Auto-expand folder when a multi-demo element is selected
|
||||||
if (changedProperties.has('selectedItem') && this.selectedItem && this.dashboardRef?.sections) {
|
if (changedProperties.has('selectedItem') && this.selectedItem && this.dashboardRef?.sections) {
|
||||||
// Find the element in any section
|
// Find the element in any section
|
||||||
|
|||||||
Reference in New Issue
Block a user