解决所有lint问题

This commit is contained in:
xintaofei
2026-03-13 23:35:51 +08:00
parent f4f70c438a
commit 39b72819ae
4 changed files with 42 additions and 40 deletions

View File

@@ -550,11 +550,7 @@ function BranchSelector({
setPopoverOpen(false)
}
function renderBranchItem(
branch: string,
displayName?: string,
indent = 0
) {
function renderBranchItem(branch: string, displayName?: string, indent = 0) {
const isCurrent = branch === selectedBranch
return (
<button
@@ -617,32 +613,33 @@ function BranchSelector({
{t("remoteBranches")}
</CollapsibleTrigger>
<CollapsibleContent>
{hasMultipleRemotes ? (
remoteNames.map((remoteName) => (
<Collapsible key={remoteName}>
<CollapsibleTrigger className="flex w-full items-center gap-2 rounded-lg py-1.5 pl-5 text-xs hover:bg-accent hover:text-accent-foreground select-none outline-hidden">
<ChevronRight className="h-3 w-3 shrink-0 transition-transform [[data-state=open]>&]:rotate-90" />
{remoteName} ({groupedRemoteBranches[remoteName].length})
</CollapsibleTrigger>
<CollapsibleContent>
{groupedRemoteBranches[remoteName].map((branch) =>
renderBranchItem(
branch,
branch.substring(remoteName.length + 1),
3
)
)}
</CollapsibleContent>
</Collapsible>
))
) : (
branchList.remote.map((branch) => {
const slashIndex = branch.indexOf("/")
const shortName =
slashIndex > 0 ? branch.substring(slashIndex + 1) : branch
return renderBranchItem(branch, shortName, 1)
})
)}
{hasMultipleRemotes
? remoteNames.map((remoteName) => (
<Collapsible key={remoteName}>
<CollapsibleTrigger className="flex w-full items-center gap-2 rounded-lg py-1.5 pl-5 text-xs hover:bg-accent hover:text-accent-foreground select-none outline-hidden">
<ChevronRight className="h-3 w-3 shrink-0 transition-transform [[data-state=open]>&]:rotate-90" />
{remoteName} (
{groupedRemoteBranches[remoteName].length})
</CollapsibleTrigger>
<CollapsibleContent>
{groupedRemoteBranches[remoteName].map((branch) =>
renderBranchItem(
branch,
branch.substring(remoteName.length + 1),
3
)
)}
</CollapsibleContent>
</Collapsible>
))
: branchList.remote.map((branch) => {
const slashIndex = branch.indexOf("/")
const shortName =
slashIndex > 0
? branch.substring(slashIndex + 1)
: branch
return renderBranchItem(branch, shortName, 1)
})}
</CollapsibleContent>
</Collapsible>
)}

View File

@@ -681,7 +681,8 @@ export function BranchDropdown({
<Collapsible key={remoteName}>
<CollapsibleTrigger className="flex w-full items-center gap-2.5 rounded-xl px-3 py-2 pl-6 text-sm hover:bg-accent hover:text-accent-foreground select-none outline-hidden">
<ChevronRight className="h-3 w-3 shrink-0 transition-transform [[data-state=open]>&]:rotate-90" />
{remoteName} ({groupedRemoteBranches[remoteName].length})
{remoteName} (
{groupedRemoteBranches[remoteName].length})
</CollapsibleTrigger>
<CollapsibleContent className="pl-3">
{groupedRemoteBranches[remoteName].map((b) =>

View File

@@ -76,15 +76,17 @@ export function RemoteManageDialog({
const addDraft = () => {
setDrafts((prev) => [
...prev,
{ originalName: null, originalUrl: "", name: "", url: "", deleted: false },
{
originalName: null,
originalUrl: "",
name: "",
url: "",
deleted: false,
},
])
}
const updateDraft = (
index: number,
field: "name" | "url",
value: string
) => {
const updateDraft = (index: number, field: "name" | "url", value: string) => {
setDrafts((prev) =>
prev.map((d, i) => (i === index ? { ...d, [field]: value } : d))
)

View File

@@ -69,8 +69,10 @@ export function StatusBarTokens() {
const rawLiveSize = activeConn?.usage?.size ?? null
// Treat live used=0 as "no data" so we fall back to sessionStats —
// Claude Code sends used=0 for synthetic local commands (/context etc.)
const liveContextUsed = rawLiveUsed != null && rawLiveUsed > 0 ? rawLiveUsed : null
const liveContextMax = rawLiveSize != null && rawLiveSize > 0 ? rawLiveSize : null
const liveContextUsed =
rawLiveUsed != null && rawLiveUsed > 0 ? rawLiveUsed : null
const liveContextMax =
rawLiveSize != null && rawLiveSize > 0 ? rawLiveSize : null
const contextUsed =
liveContextUsed ?? sessionStats?.context_window_used_tokens ?? null