mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-31 19:45:15 +02:00
feat: Apply minor UI styling adjustments to sidebar and progress components. Fixed linting for both frontend and backend
This commit is contained in:
parent
c28a90fc29
commit
70383931bb
4 changed files with 17 additions and 13 deletions
|
|
@ -72,10 +72,10 @@ def format_mentioned_documents_as_context(documents: list[Document]) -> str:
|
||||||
def extract_todos_from_deepagents(command_output) -> dict:
|
def extract_todos_from_deepagents(command_output) -> dict:
|
||||||
"""
|
"""
|
||||||
Extract todos from deepagents' TodoListMiddleware Command output.
|
Extract todos from deepagents' TodoListMiddleware Command output.
|
||||||
|
|
||||||
deepagents returns a Command object with:
|
deepagents returns a Command object with:
|
||||||
- Command.update['todos'] = [{'content': '...', 'status': '...'}]
|
- Command.update['todos'] = [{'content': '...', 'status': '...'}]
|
||||||
|
|
||||||
Returns the todos directly (no transformation needed - UI matches deepagents format).
|
Returns the todos directly (no transformation needed - UI matches deepagents format).
|
||||||
"""
|
"""
|
||||||
todos_data = []
|
todos_data = []
|
||||||
|
|
@ -89,7 +89,7 @@ def extract_todos_from_deepagents(command_output) -> dict:
|
||||||
todos_data = command_output.get("todos", [])
|
todos_data = command_output.get("todos", [])
|
||||||
elif "update" in command_output and isinstance(command_output["update"], dict):
|
elif "update" in command_output and isinstance(command_output["update"], dict):
|
||||||
todos_data = command_output["update"].get("todos", [])
|
todos_data = command_output["update"].get("todos", [])
|
||||||
|
|
||||||
return {"todos": todos_data}
|
return {"todos": todos_data}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,7 @@ export function AllNotesSidebar({
|
||||||
aria-label={t("all_notes") || "All Notes"}
|
aria-label={t("all_notes") || "All Notes"}
|
||||||
>
|
>
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="flex-shrink-0 p-4 pb-3 space-y-3 border-b">
|
<div className="flex-shrink-0 p-4 pb-3 space-y-3">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<h2 className="text-lg font-semibold">{t("all_notes") || "All Notes"}</h2>
|
<h2 className="text-lg font-semibold">{t("all_notes") || "All Notes"}</h2>
|
||||||
<Button
|
<Button
|
||||||
|
|
@ -370,7 +370,7 @@ export function AllNotesSidebar({
|
||||||
|
|
||||||
{/* Footer with Add Note button */}
|
{/* Footer with Add Note button */}
|
||||||
{onAddNote && notes.length > 0 && (
|
{onAddNote && notes.length > 0 && (
|
||||||
<div className="flex-shrink-0 p-3 border-t">
|
<div className="flex-shrink-0 p-3">
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onAddNote();
|
onAddNote();
|
||||||
|
|
|
||||||
|
|
@ -172,13 +172,16 @@ export const Plan: FC<PlanProps> = ({
|
||||||
|
|
||||||
{showProgress && (
|
{showProgress && (
|
||||||
<div className="mt-3 space-y-1.5">
|
<div className="mt-3 space-y-1.5">
|
||||||
<div className="flex items-center justify-between text-xs text-muted-foreground">
|
<div className="flex items-center justify-between text-xs text-muted-foreground">
|
||||||
<span>
|
<span>
|
||||||
{progress.completed} of {progress.total} complete
|
{progress.completed} of {progress.total} complete
|
||||||
</span>
|
</span>
|
||||||
<span>{Math.round(progress.percentage)}%</span>
|
<span>{Math.round(progress.percentage)}%</span>
|
||||||
</div>
|
</div>
|
||||||
<Progress value={progress.percentage} className="h-1.5 bg-muted [&>div]:bg-muted-foreground" />
|
<Progress
|
||||||
|
value={progress.percentage}
|
||||||
|
className="h-1.5 bg-muted [&>div]:bg-muted-foreground"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,8 @@ export const WriteTodosToolUI = makeAssistantToolUI<WriteTodosData, WriteTodosDa
|
||||||
}
|
}
|
||||||
|
|
||||||
// Success - render the plan
|
// Success - render the plan
|
||||||
const planToRender = currentPlanState || (hasTodos ? parseSerializablePlan({ todos: data.todos }) : null);
|
const planToRender =
|
||||||
|
currentPlanState || (hasTodos ? parseSerializablePlan({ todos: data.todos }) : null);
|
||||||
if (!planToRender) {
|
if (!planToRender) {
|
||||||
return <WriteTodosLoading />;
|
return <WriteTodosLoading />;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue