SarahXia0405 commited on
Commit
f489e78
·
verified ·
1 Parent(s): 6170d99

Update web/src/components/sidebar/LeftSidebar.tsx

Browse files
web/src/components/sidebar/LeftSidebar.tsx CHANGED
@@ -1,6 +1,9 @@
1
  import React from "react";
2
  import { Separator } from "../ui/separator";
3
 
 
 
 
4
  import type {
5
  SavedChat,
6
  Workspace,
@@ -12,11 +15,7 @@ import type {
12
  SavedItem,
13
  } from "../../App";
14
 
15
- import { CourseInfoSection } from "./CourseInfoSection";
16
- import { SavedChatSection } from "./SavedChatSection";
17
-
18
  type Props = {
19
- // ====== settings / user ======
20
  learningMode: LearningMode;
21
  language: Language;
22
  onLearningModeChange: (m: LearningMode) => void;
@@ -32,7 +31,6 @@ type Props = {
32
 
33
  onEditProfile: () => void;
34
 
35
- // ====== saved items (暂时不动你现有逻辑;这里先不渲染也不会影响) ======
36
  savedItems: SavedItem[];
37
  recentlySavedId: string | null;
38
  onUnsave: (id: string) => void;
@@ -44,18 +42,16 @@ type Props = {
44
  workspaceId?: string
45
  ) => void;
46
 
47
- // ====== saved chats ======
48
  savedChats: SavedChat[];
49
  onLoadChat: (chat: SavedChat) => void;
50
  onDeleteSavedChat: (id: string) => void;
51
  onRenameSavedChat: (id: string, newTitle: string) => void;
52
 
53
- // ====== workspace / course ======
54
  currentWorkspaceId: string;
55
  workspaces: Workspace[];
56
 
57
  selectedCourse: string;
58
- availableCourses: any[]; // 你 App 里是 CourseInfo[],这里放宽避免类型冲突
59
  };
60
 
61
  export function LeftSidebar(props: Props) {
@@ -73,12 +69,20 @@ export function LeftSidebar(props: Props) {
73
 
74
  return (
75
  <div className="h-full w-full flex flex-col min-h-0">
76
- {/* ✅ 强制可见用于确认你改的文真的在跑 */}
77
- <div className="px-4 pt-2 text-xs text-red-600 flex-shrink-0">
78
- SIDEBAR ACTIVE (components/sidebar/LeftSidebar.tsx)
 
 
 
 
 
 
 
 
79
  </div>
80
 
81
- {/* ===== Course Info(不滚动)===== */}
82
  <div className="flex-shrink-0">
83
  <CourseInfoSection
84
  currentWorkspaceId={currentWorkspaceId}
@@ -88,12 +92,10 @@ export function LeftSidebar(props: Props) {
88
  />
89
  </div>
90
 
91
- {/* 固定分割线颜色 */}
92
  <Separator className="flex-shrink-0 bg-[#ECECF1]" />
93
 
94
- {/* ===== Saved Chat(唯一滚动区)===== */}
95
  <div className="flex-1 min-h-0 overflow-hidden">
96
- {/* 让 SavedChatSection 自己不要 overflow;滚动归这里 */}
97
  <div className="h-full min-h-0 panelScroll">
98
  <SavedChatSection
99
  isLoggedIn={isLoggedIn}
 
1
  import React from "react";
2
  import { Separator } from "../ui/separator";
3
 
4
+ import { CourseInfoSection } from "./CourseInfoSection";
5
+ import { SavedChatSection } from "./SavedChatSection";
6
+
7
  import type {
8
  SavedChat,
9
  Workspace,
 
15
  SavedItem,
16
  } from "../../App";
17
 
 
 
 
18
  type Props = {
 
19
  learningMode: LearningMode;
20
  language: Language;
21
  onLearningModeChange: (m: LearningMode) => void;
 
31
 
32
  onEditProfile: () => void;
33
 
 
34
  savedItems: SavedItem[];
35
  recentlySavedId: string | null;
36
  onUnsave: (id: string) => void;
 
42
  workspaceId?: string
43
  ) => void;
44
 
 
45
  savedChats: SavedChat[];
46
  onLoadChat: (chat: SavedChat) => void;
47
  onDeleteSavedChat: (id: string) => void;
48
  onRenameSavedChat: (id: string, newTitle: string) => void;
49
 
 
50
  currentWorkspaceId: string;
51
  workspaces: Workspace[];
52
 
53
  selectedCourse: string;
54
+ availableCourses: any[];
55
  };
56
 
57
  export function LeftSidebar(props: Props) {
 
69
 
70
  return (
71
  <div className="h-full w-full flex flex-col min-h-0">
72
+ {/* ✅ 提示只要这个组件在跑,你不可能看不到 */}
73
+ <div
74
+ style={{
75
+ background: "yellow",
76
+ color: "red",
77
+ fontWeight: 700,
78
+ padding: "8px 12px",
79
+ borderBottom: "2px solid red",
80
+ }}
81
+ >
82
+ SIDEBAR ACTIVE: web/src/components/sidebar/LeftSidebar.tsx
83
  </div>
84
 
85
+ {/* Course info(不滚动) */}
86
  <div className="flex-shrink-0">
87
  <CourseInfoSection
88
  currentWorkspaceId={currentWorkspaceId}
 
92
  />
93
  </div>
94
 
 
95
  <Separator className="flex-shrink-0 bg-[#ECECF1]" />
96
 
97
+ {/* Saved chats(唯一滚动区) */}
98
  <div className="flex-1 min-h-0 overflow-hidden">
 
99
  <div className="h-full min-h-0 panelScroll">
100
  <SavedChatSection
101
  isLoggedIn={isLoggedIn}