File tree Expand file tree Collapse file tree 4 files changed +63
-4
lines changed
src/routes/page/agent/[agentId]/agent-components Expand file tree Collapse file tree 4 files changed +63
-4
lines changed Original file line number Diff line number Diff line change 4545 /** @type {import('$agentTypes').AgentKnowledgeBase[]} */
4646 let innerKnowledgeBases = [];
4747
48+ /** @type {HTMLElement} */
49+ let scrollContainer;
50+
4851 onMount (async () => {
4952 getVectorKnowledgeCollections ().then (data => {
5053 const list = data? .map (x => {
142145 disabled: false
143146 }
144147 ];
148+ scrollToBottom ();
145149 handleAgentChange ();
146150 }
147151
178182 }) || [];
179183 }
180184
185+ function scrollToBottom () {
186+ if (scrollContainer) {
187+ setTimeout (() => {
188+ scrollContainer .scrollTo ({
189+ top: scrollContainer .scrollHeight ,
190+ behavior: ' smooth'
191+ });
192+ }, 0 );
193+ }
194+ }
181195< / script>
182196
183197< Card>
187201 < h6 class = " mt-1 mb-3" > Make your Agent have memory< / h6>
188202 < / div>
189203
190- < div class = " agent-utility-container" >
204+ < div class = " agent-utility-container" bind : this = {scrollContainer} >
191205 {#each innerKnowledgeBases as knowledge, uid (uid)}
192206 < div class = " utility-wrapper" >
193207 < div class = " utility-row utility-row-primary" >
Original file line number Diff line number Diff line change 5454 /** @type {import('$agentTypes').AgentMcpTool[]} */
5555 let innerMcps = [];
5656
57+ /** @type {HTMLElement} */
58+ let scrollContainer;
59+
5760
5861 onMount (async () => {
5962 getServerConfigs ().then (res => {
131134 functions: []
132135 }
133136 ];
137+ scrollToBottom ();
134138 handleAgentChange ();
135139 }
136140
207211 innerRefresh (innerMcps);
208212 handleAgentChange ();
209213 }
214+
215+ function scrollToBottom () {
216+ if (scrollContainer) {
217+ setTimeout (() => {
218+ scrollContainer .scrollTo ({
219+ top: scrollContainer .scrollHeight ,
220+ behavior: ' smooth'
221+ });
222+ }, 0 );
223+ }
224+ }
210225< / script>
211226
212227< Card>
216231 < h6 class = " mt-1 mb-3" > Tools powered by MCP Servers< / h6>
217232 < / div>
218233
219- < div class = " agent-utility-container" >
234+ < div class = " agent-utility-container" bind : this = {scrollContainer} >
220235 {#each innerMcps as mcp, uid (uid)}
221236 < div class = " utility-wrapper" >
222237 < div class = " utility-row utility-row-primary" >
Original file line number Diff line number Diff line change 4141 /** @type {import('$agentTypes').AgentRule[]} */
4242 let innerRules = [];
4343
44+ /** @type {HTMLElement} */
45+ let scrollContainer;
46+
4447 onMount (async () => {
4548 getAgentRuleOptions ().then (data => {
4649 const list = data? .map (x => {
9194 disabled: false
9295 }
9396 ];
97+ scrollToBottom ();
9498 handleAgentChange ();
9599 }
96100
143147 }) || [];
144148 }
145149
150+ function scrollToBottom () {
151+ if (scrollContainer) {
152+ setTimeout (() => {
153+ scrollContainer .scrollTo ({
154+ top: scrollContainer .scrollHeight ,
155+ behavior: ' smooth'
156+ });
157+ }, 0 );
158+ }
159+ }
146160< / script>
147161
148162< Card>
152166 < h6 class = " mt-1 mb-3" > Wake- up your agent by rules< / h6>
153167 < / div>
154168
155- < div class = " agent-utility-container" >
169+ < div class = " agent-utility-container" bind : this = {scrollContainer} >
156170 {#each innerRules as rule, uid (uid)}
157171 < div class = " utility-wrapper" >
158172 < div class = " utility-row utility-row-primary" >
Original file line number Diff line number Diff line change 4242 /** @type {import('$agentTypes').AgentUtility[]} */
4343 let innerUtilities = [];
4444
45+ /** @type {HTMLElement} */
46+ let scrollContainer;
47+
4548 onMount (async () => {
4649 resizeWindow ();
4750 getAgentUtilityOptions ().then (data => {
127130 items: []
128131 }
129132 ];
133+ scrollToBottom ();
134+ handleAgentChange ();
130135 }
131136
132137 /** @param {number} idx */
267272 innerRefresh (innerUtilities);
268273 handleAgentChange ();
269274 }
275+
276+ function scrollToBottom () {
277+ if (scrollContainer) {
278+ setTimeout (() => {
279+ scrollContainer .scrollTo ({
280+ top: scrollContainer .scrollHeight ,
281+ behavior: ' smooth'
282+ });
283+ }, 0 );
284+ }
285+ }
270286< / script>
271287
272288< svelte: window on: resize= {() => resizeWindow ()}/ >
278294 < h6 class = " mt-1 mb-3" > Tools shared across plugins< / h6>
279295 < / div>
280296
281- < div class = " agent-utility-container" >
297+ < div class = " agent-utility-container" bind : this = {scrollContainer} >
282298 {#if ! agent? .is_router }
283299 < div class = " merge-utility" >
284300 < Input
You can’t perform that action at this time.
0 commit comments