diff --git a/web/src/client/components/clickable-path.ts b/web/src/client/components/clickable-path.ts index 9d232a5f..6c10f8b5 100644 --- a/web/src/client/components/clickable-path.ts +++ b/web/src/client/components/clickable-path.ts @@ -8,7 +8,7 @@ * @fires path-copy-failed - When path copy fails (detail: { path: string, error: string }) */ import { html, LitElement } from 'lit'; -import { customElement, property, state } from 'lit/decorators.js'; +import { customElement, property } from 'lit/decorators.js'; import { createLogger } from '../utils/logger.js'; import { copyToClipboard, formatPathForDisplay } from '../utils/path-utils.js'; import './copy-icon.js'; @@ -26,10 +26,6 @@ export class ClickablePath extends LitElement { @property({ type: String }) class = ''; @property({ type: Number }) iconSize = 12; - // Cache formatted path to avoid re-computation on every render - @state() private _formattedPath = ''; - private _lastPath = ''; - private async handleClick(e: Event) { e.stopPropagation(); e.preventDefault(); @@ -68,11 +64,7 @@ export class ClickablePath extends LitElement { render() { if (!this.path) return html``; - // Only recompute if path has changed - if (this.path !== this._lastPath) { - this._formattedPath = formatPathForDisplay(this.path); - this._lastPath = this.path; - } + const displayPath = formatPathForDisplay(this.path); return html`
- ${this._formattedPath} + ${displayPath}
`;