Fix Features config tab order management
- Tabs now use applied order (moduleOrder) instead of local pending order - Cards still show local order for drag preview feedback - Cancel button correctly restores to the applied state from context - Apply button updates both tabs and sidebar after saving 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -79,6 +79,11 @@ export function SwipeTabs<T extends string | number>({
|
||||
isDragging: false
|
||||
});
|
||||
|
||||
const shouldIgnoreSwipe = useCallback((target: EventTarget | null) => {
|
||||
if (!target || typeof (target as Element).closest !== 'function') return false;
|
||||
return Boolean((target as Element).closest('[data-swipe-ignore="true"]'));
|
||||
}, []);
|
||||
|
||||
const applyTransform = useCallback((offset: number, animate: boolean) => {
|
||||
const track = trackRef.current;
|
||||
if (!track) return;
|
||||
@@ -310,6 +315,7 @@ export function SwipeTabs<T extends string | number>({
|
||||
);
|
||||
|
||||
const handlePointerDown = (event: PointerEvent<HTMLDivElement>) => {
|
||||
if (swipeDisabled || shouldIgnoreSwipe(event.target)) return;
|
||||
if (event.pointerType === 'mouse' && event.button !== 0) return;
|
||||
if (dragRef.current.isActive) return;
|
||||
startDrag(event.clientX, event.clientY, event.pointerId, null);
|
||||
@@ -359,6 +365,7 @@ export function SwipeTabs<T extends string | number>({
|
||||
};
|
||||
|
||||
const handleTouchStart = (event: TouchEvent<HTMLDivElement>) => {
|
||||
if (swipeDisabled || shouldIgnoreSwipe(event.target)) return;
|
||||
if (dragRef.current.isActive) return;
|
||||
const touch = event.changedTouches[0];
|
||||
if (!touch) return;
|
||||
|
||||
Reference in New Issue
Block a user