mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Sort top level files based on directory or not; fix task header styles
This commit is contained in:
@@ -449,7 +449,20 @@ export class ClaudeDev {
|
|||||||
async listFilesTopLevel(dirPath: string): Promise<string> {
|
async listFilesTopLevel(dirPath: string): Promise<string> {
|
||||||
try {
|
try {
|
||||||
const files = await listFiles(dirPath, false)
|
const files = await listFiles(dirPath, false)
|
||||||
const result = files.map((file) => path.relative(dirPath, file)).join("\n")
|
const result = files
|
||||||
|
.map((file) => {
|
||||||
|
const relativePath = path.relative(dirPath, file)
|
||||||
|
return file.endsWith("/") ? relativePath + "/" : relativePath
|
||||||
|
})
|
||||||
|
.sort((a, b) => {
|
||||||
|
const aIsDir = a.endsWith("/")
|
||||||
|
const bIsDir = b.endsWith("/")
|
||||||
|
if (aIsDir !== bIsDir) {
|
||||||
|
return aIsDir ? -1 : 1
|
||||||
|
}
|
||||||
|
return a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" })
|
||||||
|
})
|
||||||
|
.join("\n")
|
||||||
const { response, text } = await this.ask(
|
const { response, text } = await this.ask(
|
||||||
"tool",
|
"tool",
|
||||||
JSON.stringify({ tool: "listFilesTopLevel", path: dirPath, content: result } as ClaudeSayTool)
|
JSON.stringify({ tool: "listFilesTopLevel", path: dirPath, content: result } as ClaudeSayTool)
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ const TaskHeader: React.FC<TaskHeaderProps> = ({ taskText, tokensIn, tokensOut,
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div style={{ display: "flex", flexDirection: "column", gap: "4px" }}>
|
<div style={{ display: "flex", flexDirection: "column", gap: "4px" }}>
|
||||||
<div style={{ display: "flex", alignItems: "center", gap: "5px" }}>
|
<div style={{ display: "flex", alignItems: "center", gap: "4px" }}>
|
||||||
<span style={{ fontWeight: "bold" }}>Tokens:</span>
|
<span style={{ fontWeight: "bold" }}>Tokens:</span>
|
||||||
<span style={{ display: "flex", alignItems: "center", gap: "3px" }}>
|
<span style={{ display: "flex", alignItems: "center", gap: "3px" }}>
|
||||||
<i
|
<i
|
||||||
@@ -158,23 +158,29 @@ const TaskHeader: React.FC<TaskHeaderProps> = ({ taskText, tokensIn, tokensOut,
|
|||||||
{tokensIn.toLocaleString()}
|
{tokensIn.toLocaleString()}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
alignItems: "center",
|
||||||
|
}}>
|
||||||
<div style={{ display: "flex", alignItems: "center", gap: "4px" }}>
|
<div style={{ display: "flex", alignItems: "center", gap: "4px" }}>
|
||||||
<span style={{ fontWeight: "bold" }}>API Cost:</span>
|
<span style={{ fontWeight: "bold" }}>API Cost:</span>
|
||||||
<span>${totalCost.toFixed(4)}</span>
|
<span>${totalCost.toFixed(4)}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<VSCodeButton
|
<VSCodeButton
|
||||||
appearance="icon"
|
appearance="icon"
|
||||||
onClick={handleDownload}
|
onClick={handleDownload}
|
||||||
style={{
|
style={{
|
||||||
position: "absolute",
|
marginBottom: "-2px",
|
||||||
bottom: "9.5px",
|
marginRight: "-2.5px",
|
||||||
right: "9px",
|
|
||||||
}}>
|
}}>
|
||||||
<div style={{ fontSize: "10.5px", fontWeight: "bold", opacity: 0.6 }}>EXPORT .MD</div>
|
<div style={{ fontSize: "10.5px", fontWeight: "bold", opacity: 0.6 }}>EXPORT .MD</div>
|
||||||
</VSCodeButton>
|
</VSCodeButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user