Skip to content

Commit a759e86

Browse files
committed
refactor: cleaner ThresholdSlider with proper types and hooks
- Extract AutoCompactionConfig type and export it - Create useDraggableThreshold hook for drag logic - Extract Triangle and ThresholdIndicator sub-components - Simplify VerticalTokenMeter structure - Add proper TooltipWrapper for tooltips - Document container requirements in JSDoc
1 parent ed9b710 commit a759e86

File tree

3 files changed

+255
-260
lines changed

3 files changed

+255
-260
lines changed

src/browser/components/RightSidebar/CostsTab.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,12 @@ const CostsTabComponent: React.FC<CostsTabProps> = ({ workspaceId }) => {
235235
{/* Threshold slider overlay - inside bar for proper positioning */}
236236
{maxTokens && (
237237
<ThresholdSlider
238-
threshold={autoCompactThreshold}
239-
enabled={autoCompactEnabled}
240-
onThresholdChange={setAutoCompactThreshold}
241-
onEnabledChange={setAutoCompactEnabled}
238+
config={{
239+
enabled: autoCompactEnabled,
240+
threshold: autoCompactThreshold,
241+
setEnabled: setAutoCompactEnabled,
242+
setThreshold: setAutoCompactThreshold,
243+
}}
242244
orientation="horizontal"
243245
/>
244246
)}

0 commit comments

Comments
 (0)