mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
Remove formatPathForDisplay function completely
- Delete formatPathForDisplay function from path-utils.ts - Update all components to use displayWorkingDir from server - Clean up imports in affected components - Add refactoring philosophy note to CLAUDE.md
This commit is contained in:
parent
856dc3ce91
commit
f2eb262384
4 changed files with 10 additions and 22 deletions
|
|
@ -52,4 +52,9 @@ NEVER give a code reference or location in any other format.
|
||||||
|
|
||||||
## CRITICAL
|
## CRITICAL
|
||||||
**IMPORTANT**: BEFORE YOU DO ANYTHING, READ spec.md IN FULL USING THE READ TOOL!
|
**IMPORTANT**: BEFORE YOU DO ANYTHING, READ spec.md IN FULL USING THE READ TOOL!
|
||||||
**IMPORTANT**: NEVER USE GREP. ALWAYS USE RIPGREP!
|
**IMPORTANT**: NEVER USE GREP. ALWAYS USE RIPGREP!
|
||||||
|
|
||||||
|
## Refactoring Philosophy
|
||||||
|
- We do not care about deprecation - remove old code completely
|
||||||
|
- Always prefer clean refactoring over gradual migration
|
||||||
|
- Delete unused functions and code paths immediately
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
import { html, LitElement } from 'lit';
|
import { html, LitElement } from 'lit';
|
||||||
import { customElement, property } from 'lit/decorators.js';
|
import { customElement, property } from 'lit/decorators.js';
|
||||||
import { createLogger } from '../utils/logger.js';
|
import { createLogger } from '../utils/logger.js';
|
||||||
import { copyToClipboard, formatPathForDisplay } from '../utils/path-utils.js';
|
import { copyToClipboard } from '../utils/path-utils.js';
|
||||||
import './copy-icon.js';
|
import './copy-icon.js';
|
||||||
|
|
||||||
const logger = createLogger('clickable-path');
|
const logger = createLogger('clickable-path');
|
||||||
|
|
@ -65,7 +65,7 @@ export class ClickablePath extends LitElement {
|
||||||
render() {
|
render() {
|
||||||
if (!this.path) return html``;
|
if (!this.path) return html``;
|
||||||
|
|
||||||
const displayText = this.displayPath || formatPathForDisplay(this.path);
|
const displayText = this.displayPath || this.path;
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ import type { Session } from '../../shared/types.js';
|
||||||
import type { AuthClient } from '../services/auth-client.js';
|
import type { AuthClient } from '../services/auth-client.js';
|
||||||
import './session-card.js';
|
import './session-card.js';
|
||||||
import { createLogger } from '../utils/logger.js';
|
import { createLogger } from '../utils/logger.js';
|
||||||
import { formatPathForDisplay } from '../utils/path-utils.js';
|
|
||||||
|
|
||||||
const logger = createLogger('session-list');
|
const logger = createLogger('session-list');
|
||||||
|
|
||||||
|
|
@ -294,7 +293,7 @@ export class SessionList extends LitElement {
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="text-xs text-dark-text-muted truncate">
|
<div class="text-xs text-dark-text-muted truncate">
|
||||||
${formatPathForDisplay(session.workingDir)}
|
${session.displayWorkingDir || session.workingDir}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-2 flex-shrink-0">
|
<div class="flex items-center gap-2 flex-shrink-0">
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* Path utilities for formatting and displaying paths
|
* Path utilities for clipboard operations
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* Format a file path for display by replacing the home directory with ~
|
|
||||||
*
|
|
||||||
* NOTE: This function is deprecated and only used as a fallback.
|
|
||||||
* The server now provides pre-formatted paths via the displayWorkingDir field.
|
|
||||||
*
|
|
||||||
* @param path The absolute path to format
|
|
||||||
* @returns The formatted path (no transformation applied)
|
|
||||||
* @deprecated Use displayWorkingDir from server response instead
|
|
||||||
*/
|
|
||||||
export function formatPathForDisplay(path: string): string {
|
|
||||||
// Client-side cannot reliably detect the home directory
|
|
||||||
// Return the path as-is; server should provide formatted paths
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy text to clipboard with fallback for older browsers
|
* Copy text to clipboard with fallback for older browsers
|
||||||
* @param text The text to copy
|
* @param text The text to copy
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue