8
8
Alert ,
9
9
Button ,
10
10
Collapse ,
11
- Divider ,
12
11
Dropdown ,
13
12
Flex ,
14
13
Input ,
@@ -1149,41 +1148,45 @@ export function LLMCellTool({
1149
1148
1150
1149
// Create marks dynamically
1151
1150
const marks : SliderSingleProps [ "marks" ] = {
1152
- 0 : "this cell " ,
1151
+ 0 : "0 " ,
1153
1152
} ;
1154
1153
1155
- // Add marks for boundaries
1154
+ // Only add boundary marks if they don't conflict with -2/+2
1156
1155
if ( minValue < 0 ) {
1157
- marks [ minValue ] = "first" ;
1156
+ marks [ minValue ] = minValue === - 2 ? "-2" : "first" ;
1158
1157
}
1159
1158
if ( maxValue > 0 ) {
1160
- marks [ maxValue ] = "last" ;
1159
+ marks [ maxValue ] = maxValue === 2 ? "+2" : "last" ;
1161
1160
}
1162
1161
1163
- // Add -2 and +2 marks if they're within range
1164
- if ( minValue <= - 2 ) {
1162
+ // Add -2 and +2 marks only if they're not at the boundaries
1163
+ if ( minValue < - 2 ) {
1165
1164
marks [ - 2 ] = "-2" ;
1166
1165
}
1167
- if ( maxValue >= 2 ) {
1166
+ if ( maxValue > 2 ) {
1168
1167
marks [ 2 ] = "+2" ;
1169
1168
}
1170
1169
1171
1170
return (
1172
1171
< >
1173
- < Divider orientation = "left" >
1174
- < Text > Context Selection</ Text >
1175
- </ Divider >
1176
1172
< Paragraph >
1177
- < Slider
1178
- range
1179
- marks = { marks }
1180
- min = { minValue }
1181
- max = { maxValue }
1182
- step = { 1 }
1183
- value = { adjustedRange }
1184
- onChange = { ( value ) => setContextRange ( value as [ number , number ] ) }
1185
- style = { { margin : "20px 10px" } }
1186
- />
1173
+ < Flex align = "center" gap = "10px" >
1174
+ < Text > Context:</ Text >
1175
+ < Slider
1176
+ range
1177
+ marks = { marks }
1178
+ min = { minValue }
1179
+ max = { maxValue }
1180
+ step = { 1 }
1181
+ value = { adjustedRange }
1182
+ onChange = { ( value ) => setContextRange ( value as [ number , number ] ) }
1183
+ style = { { flex : 1 , margin : "0 20px" } }
1184
+ />
1185
+ </ Flex >
1186
+ </ Paragraph >
1187
+ < Paragraph type = "secondary" >
1188
+ Selected: { Math . abs ( adjustedRange [ 0 ] ) } cells above + current cell +{ " " }
1189
+ { adjustedRange [ 1 ] } cells below
1187
1190
</ Paragraph >
1188
1191
< Paragraph >
1189
1192
< Flex align = "center" gap = "10px" >
@@ -1202,12 +1205,6 @@ export function LLMCellTool({
1202
1205
</ Flex >
1203
1206
</ Flex >
1204
1207
</ Paragraph >
1205
- < Paragraph >
1206
- < Text type = "secondary" >
1207
- Selected: { Math . abs ( adjustedRange [ 0 ] ) } cells above + current cell +{ " " }
1208
- { adjustedRange [ 1 ] } cells below
1209
- </ Text >
1210
- </ Paragraph >
1211
1208
</ >
1212
1209
) ;
1213
1210
}
0 commit comments