File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 import type { ModelInfo } from ' $lib/types' ;
1111
1212 let isDropdownOpen = false ;
13+ let buttonRef: HTMLButtonElement ;
14+ let dropdownPosition = { top: 0 , left: 0 };
1315
1416 // Filter models for mobile devices
1517 $ : filteredModels = $availableModels .filter ((model ) => {
5860 console .log (' Toggle dropdown clicked, current state:' , isDropdownOpen );
5961 isDropdownOpen = ! isDropdownOpen ;
6062 console .log (' New state:' , isDropdownOpen );
63+
64+ if (isDropdownOpen && buttonRef ) {
65+ const rect = buttonRef .getBoundingClientRect ();
66+ dropdownPosition = {
67+ top: rect .bottom + 8 ,
68+ left: rect .right - 448 // 28rem = 448px
69+ };
70+ }
6171 }
6272
6373 // Close dropdown when clicking outside
7888 class:border-red- 500={isDropdownOpen }
7989>
8090 <button
91+ bind:this ={buttonRef }
8192 class =" btn btn-sm variant-ghost-surface flex items-center space-x-2"
8293 on:click ={() => {
8394 console .log (' Button click event fired' );
96107
97108 {#if isDropdownOpen }
98109 <div
99- class =" absolute top-full right-0 mt-2 w-[28rem] bg-surface-100-800-token border border-surface-300-600-token rounded-lg shadow-xl z-[9999] max-h-[32rem] overflow-y-auto"
110+ class =" fixed w-[28rem] bg-surface-100-800-token border border-surface-300-600-token rounded-lg shadow-xl max-h-[32rem] overflow-y-auto"
111+ style ="z-index: 999999 !important; top: {dropdownPosition .top }px; left: {dropdownPosition .left }px;"
100112 >
101113 <div class =" p-4 border-b border-surface-300-600-token" >
102114 <h3 class =" font-semibold text-lg text-surface-700-200-token" >Select LLM Model</h3 >
Original file line number Diff line number Diff line change 175175{#if featureManager .isEnabled (' clientSideRAG' )}
176176 <!-- Debug: RAG Panel is rendering -->
177177 <div
178- class =" fixed top-16 right-0 bg-surface-100-800-token border-l border-surface-300-600-token p-4 w-80 flex flex-col shadow-lg z-40 transition-transform duration-300"
178+ class =" fixed top-16 right-0 bg-surface-100-800-token border-l
179+ border-surface-300-600-token p-4 w-80 flex flex-col shadow-lg z-1
180+ transition-transform duration-300"
179181 class:translate-x- 0={isVisible }
180182 class:translate-x-full ={! isVisible }
181183 style =" height: calc(100vh - 4rem);"
Original file line number Diff line number Diff line change 33 import type { Theme } from ' $lib/types' ;
44
55 let isDropdownOpen = false ;
6+ let buttonRef: HTMLButtonElement ;
7+ let dropdownPosition = { top: 0 , left: 0 };
68
79 const themes: { name: Theme ; label: string ; description: string ; preview: string }[] = [
810 {
6870 console .log (' Theme dropdown clicked, current state:' , isDropdownOpen );
6971 isDropdownOpen = ! isDropdownOpen ;
7072 console .log (' New theme dropdown state:' , isDropdownOpen );
73+
74+ if (isDropdownOpen && buttonRef ) {
75+ const rect = buttonRef .getBoundingClientRect ();
76+ dropdownPosition = {
77+ top: rect .bottom + 8 ,
78+ left: rect .right - 320 // 20rem = 320px
79+ };
80+ }
7181 }
7282
7383 // Close dropdown when clicking outside
8898 class:border-blue- 500={isDropdownOpen }
8999>
90100 <button
101+ bind:this ={buttonRef }
91102 class =" btn btn-sm variant-ghost-surface flex items-center space-x-2"
92103 on:click ={() => {
93104 console .log (' Theme button click event fired' );
111122
112123 {#if isDropdownOpen }
113124 <div
114- class =" absolute top-full right-0 mt-2 w-80 bg-surface-100-800-token border border-surface-300-600-token rounded-lg shadow-xl z-[9999] max-h-96 overflow-y-auto"
125+ class =" fixed w-80 bg-surface-100-800-token border border-surface-300-600-token rounded-lg shadow-xl max-h-96 overflow-y-auto"
126+ style ="z-index: 999999 !important; top: {dropdownPosition .top }px; left: {dropdownPosition .left }px;"
115127 >
116128 <div class =" p-4 border-b border-surface-300-600-token" >
117129 <h3 class =" font-semibold text-lg text-surface-700-200-token" >Choose Theme</h3 >
You can’t perform that action at this time.
0 commit comments