-
Notifications
You must be signed in to change notification settings - Fork 30
🤖 feat: draggable auto-compaction threshold slider #821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
Author
|
/rerun-workflow |
dd08a62 to
28f9b77
Compare
- Add ThresholdSlider component for draggable threshold indicator on Context Usage bar (horizontal and vertical orientations) - Slider extends above/below bar for visibility, shows during drag - Dragging to 100% disables auto-compaction, dragging back enables - Tooltip shows live feedback during drag operation - Remove AutoCompactionSettings component (replaced by slider) - Store threshold per-model (not per-workspace) since different models have different context windows - Unify CompactionWarning styles: both states use subtle right-aligned text; at-threshold state is bold blue instead of large block - Add prependText method to ChatInputAPI for prepending text - Clicking warning text inserts /compact command - Add Storybook coverage for auto-compaction warning state _Generated with mux_
28f9b77 to
a350950
Compare
- Move slider outside bar div to avoid clipping - Add triangle handles at line endpoints for visual affordance - Use proper absolute positioning with centered alignment - barHeight prop for accurate vertical centering
- Use native title attribute for tooltip (simpler, no wrapper) - Slider positioned inside the bar container which has relative - Add overflow-visible to allow triangles to extend beyond bar - Remove barHeight prop - not needed with inset-0
- 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
- Remove TooltipWrapper (was breaking absolute positioning) - Use native title attribute for tooltip - Export only HorizontalThresholdSlider for now - Vertical slider disabled until horizontal is confirmed working
The slider was intermittently failing to render or receive pointer events when using Tailwind classes. Switched to inline styles which work reliably. Also: - Extracted Triangle subcomponent - Made triangle size configurable via constant - Reduced visual footprint (smaller triangles, thinner line) - Centered indicator vertically on bar - Updated tooltip to mention per-model storage
…ar rounding Regressions fixed: - Restored usagePercentage-based flex scaling in VerticalTokenMeter (bar height reflects context usage) - Fixed context usage bar rounded corners by wrapping segments in overflow-hidden container - Kept slider outside the bar container for proper positioning
…tions - ThresholdSlider component now supports both orientations - Removed 50% minimum threshold - allow 0-90% (100% = disabled) - Added VerticalThresholdSlider to VerticalTokenMeter - Both sliders share the same per-model threshold state - Use native title tooltips for hover feedback Co-authored-by: mux <mux@coder.com>
- Added position='left' and position='right' to Tooltip component - Includes collision detection (flips to opposite side if needed) - Arrow properly positioned for horizontal tooltips - Used for vertical threshold slider tooltip (avoids overflow clipping)
- Horizontal slider uses native title attribute (simpler, no clipping) - Vertical slider uses dedicated VerticalSliderTooltip portal component - Removed unused orientation param from SliderTooltip - Fixed VerticalTokenMeter flex layout for proper segment display
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Adds a draggable threshold slider to the context usage meter for adjusting auto-compaction settings visually.
Features
Implementation Notes
titletooltipposition='left'|'right'supportGenerated with
mux