all: fix formatting
diff --git a/webui/src/web-components/mobile-diff.ts b/webui/src/web-components/mobile-diff.ts
index 92d0f95..9d74518 100644
--- a/webui/src/web-components/mobile-diff.ts
+++ b/webui/src/web-components/mobile-diff.ts
@@ -1,6 +1,10 @@
import { css, html, LitElement } from "lit";
import { customElement, state } from "lit/decorators.js";
-import { GitDiffFile, GitDataService, DefaultGitDataService } from "./git-data-service";
+import {
+ GitDiffFile,
+ GitDataService,
+ DefaultGitDataService,
+} from "./git-data-service";
import "./sketch-monaco-view";
@customElement("mobile-diff")
@@ -11,7 +15,8 @@
private files: GitDiffFile[] = [];
@state()
- private fileContents: Map<string, { original: string; modified: string }> = new Map();
+ private fileContents: Map<string, { original: string; modified: string }> =
+ new Map();
@state()
private loading: boolean = false;
@@ -35,8 +40,6 @@
background-color: #ffffff;
}
-
-
.diff-container {
flex: 1;
overflow: auto;
@@ -149,7 +152,7 @@
try {
// Get base commit reference
this.baseCommit = await this.gitService.getBaseCommitRef();
-
+
// Get diff from base commit to untracked changes (empty string for working directory)
this.files = await this.gitService.getDiff(this.baseCommit, "");
@@ -181,7 +184,9 @@
// Load original content (from the base commit)
if (file.status !== "A") {
// For modified, renamed, or deleted files: load original content
- originalCode = await this.gitService.getFileContent(file.old_hash || "");
+ originalCode = await this.gitService.getFileContent(
+ file.old_hash || "",
+ );
}
// Load modified content (from working directory)
@@ -191,9 +196,14 @@
} else {
// Added/modified/renamed: use working copy content
try {
- modifiedCode = await this.gitService.getWorkingCopyContent(file.path);
+ modifiedCode = await this.gitService.getWorkingCopyContent(
+ file.path,
+ );
} catch (error) {
- console.warn(`Could not get working copy for ${file.path}:`, error);
+ console.warn(
+ `Could not get working copy for ${file.path}:`,
+ error,
+ );
modifiedCode = "";
}
}
@@ -343,7 +353,7 @@
private renderFileDiff(file: GitDiffFile) {
const content = this.fileContents.get(file.path);
const isExpanded = this.fileExpandStates.get(file.path) ?? false;
-
+
if (!content) {
return html`
<div class="file-diff">
@@ -353,7 +363,11 @@
${this.getFileStatusText(file.status)}
</span>
${this.getPathInfo(file)}
- ${this.getChangesInfo(file) ? html`<span class="file-changes">${this.getChangesInfo(file)}</span>` : ""}
+ ${this.getChangesInfo(file)
+ ? html`<span class="file-changes"
+ >${this.getChangesInfo(file)}</span
+ >`
+ : ""}
</div>
<button class="file-expand-button" disabled>
${this.renderExpandAllIcon()}
@@ -374,7 +388,11 @@
${this.getFileStatusText(file.status)}
</span>
${this.getPathInfo(file)}
- ${this.getChangesInfo(file) ? html`<span class="file-changes">${this.getChangesInfo(file)}</span>` : ""}
+ ${this.getChangesInfo(file)
+ ? html`<span class="file-changes"
+ >${this.getChangesInfo(file)}</span
+ >`
+ : ""}
</div>
<button
class="file-expand-button"
@@ -383,7 +401,9 @@
? "Collapse: Hide unchanged regions to focus on changes"
: "Expand: Show all lines including unchanged regions"}"
>
- ${isExpanded ? this.renderCollapseIcon() : this.renderExpandAllIcon()}
+ ${isExpanded
+ ? this.renderCollapseIcon()
+ : this.renderExpandAllIcon()}
</button>
</div>
<div class="monaco-container">
@@ -406,11 +426,11 @@
<div class="diff-container">
${this.loading
? html`<div class="loading">Loading diff...</div>`
- : this.error
- ? html`<div class="error">${this.error}</div>`
- : !this.files || this.files.length === 0
- ? html`<div class="empty">No changes to show</div>`
- : this.files.map(file => this.renderFileDiff(file))}
+ : this.error
+ ? html`<div class="error">${this.error}</div>`
+ : !this.files || this.files.length === 0
+ ? html`<div class="empty">No changes to show</div>`
+ : this.files.map((file) => this.renderFileDiff(file))}
</div>
`;
}
@@ -420,4 +440,4 @@
interface HTMLElementTagNameMap {
"mobile-diff": MobileDiff;
}
-}
\ No newline at end of file
+}