-
Notifications
You must be signed in to change notification settings - Fork 711
fix: issue 9835 #9514
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
base: main
Are you sure you want to change the base?
fix: issue 9835 #9514
Conversation
|
Failed to generate code suggestions for PR |
Greptile OverviewGreptile SummaryThis PR attempts to fix intermittent collapse/expand issues by adding watchers to prevent splitter values below 10px and only saving splitter positions >= 1px. However, the snap-back logic in three files contains a critical bug that prevents it from working. Key Changes:
Critical Issue: Confidence Score: 0/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant Splitter as QSplitter Component
participant Watcher as splitterModel Watcher
participant State as Component State
User->>Splitter: Drags splitter from 200px to 180px
Splitter->>Watcher: Triggers watch(newValue=180, oldValue=200)
Watcher->>Watcher: Check: 180 >= 10? TRUE
Watcher->>State: Update lastSplitterPosition = 180
Watcher->>State: Set showSidebar = true
User->>Splitter: Continues dragging to 5px
Splitter->>Watcher: Triggers watch(newValue=5, oldValue=180)
Watcher->>Watcher: Check: 5 >= 10? FALSE
Watcher->>Watcher: Check: 5 > 0 && 5 < 10 && oldValue !== lastSplitterPosition?
Note over Watcher: BUG: oldValue(180) === lastSplitterPosition(180)
Note over Watcher: Condition evaluates to FALSE, no snap-back!
Watcher->>Watcher: Check: 5 === 0? FALSE
Note over Watcher: No action taken - splitter stays at 5px
User->>User: Clicks expand/collapse button
User->>State: Calls collapseSidebar()
State->>State: Toggle showSidebar
State->>Splitter: Set splitterModel to lastSplitterPosition(180) or 0
Note over User,Splitter: Collapse/expand stops working because<br/>splitter is stuck at invalid 5px position
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, 3 comments
| } else if (newValue > 0 && newValue < 10 && oldValue !== (storePreviousStoreModel.value || 250)) { | ||
| // If dragged to less than 10px, snap back to last valid position | ||
| splitterModel.value = storePreviousStoreModel.value || 250; | ||
| showManagementTabs.value = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: snap-back logic won't work as intended - when user drags from 200→5px, oldValue will be 200 (which equals storePreviousStoreModel.value since it was just updated on line 333), so the condition oldValue !== (storePreviousStoreModel.value || 250) evaluates to false and no snap-back occurs
| } else if (newValue > 0 && newValue < 10 && oldValue !== (storePreviousStoreModel.value || 250)) { | |
| // If dragged to less than 10px, snap back to last valid position | |
| splitterModel.value = storePreviousStoreModel.value || 250; | |
| showManagementTabs.value = true; | |
| } else if (newValue > 0 && newValue < 10) { | |
| // If dragged to less than 10px, snap back to last valid position | |
| splitterModel.value = storePreviousStoreModel.value || 250; | |
| showManagementTabs.value = true; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: web/src/components/settings/index.vue
Line: 335:338
Comment:
**logic:** snap-back logic won't work as intended - when user drags from 200→5px, `oldValue` will be 200 (which equals `storePreviousStoreModel.value` since it was just updated on line 333), so the condition `oldValue !== (storePreviousStoreModel.value || 250)` evaluates to false and no snap-back occurs
```suggestion
} else if (newValue > 0 && newValue < 10) {
// If dragged to less than 10px, snap back to last valid position
splitterModel.value = storePreviousStoreModel.value || 250;
showManagementTabs.value = true;
```
How can I resolve this? If you propose a fix, please make it concise.| } else if (newValue > 0 && newValue < 10 && oldValue !== lastSplitterPosition.value) { | ||
| // If dragged to less than 10px, snap back to last valid position | ||
| splitterModel.value = lastSplitterPosition.value; | ||
| showSidebar.value = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: snap-back logic won't work as intended - when user drags from a valid position to <10px, oldValue equals lastSplitterPosition.value (updated on line 137), so the condition oldValue !== lastSplitterPosition.value is always false
| } else if (newValue > 0 && newValue < 10 && oldValue !== lastSplitterPosition.value) { | |
| // If dragged to less than 10px, snap back to last valid position | |
| splitterModel.value = lastSplitterPosition.value; | |
| showSidebar.value = true; | |
| } else if (newValue > 0 && newValue < 10) { | |
| // If dragged to less than 10px, snap back to last valid position | |
| splitterModel.value = lastSplitterPosition.value; | |
| showSidebar.value = true; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: web/src/views/Functions.vue
Line: 139:142
Comment:
**logic:** snap-back logic won't work as intended - when user drags from a valid position to <10px, `oldValue` equals `lastSplitterPosition.value` (updated on line 137), so the condition `oldValue !== lastSplitterPosition.value` is always false
```suggestion
} else if (newValue > 0 && newValue < 10) {
// If dragged to less than 10px, snap back to last valid position
splitterModel.value = lastSplitterPosition.value;
showSidebar.value = true;
```
How can I resolve this? If you propose a fix, please make it concise.| } else if (newValue > 0 && newValue < 10 && oldValue !== lastSplitterPosition.value) { | ||
| // If dragged to less than 10px, snap back to last valid position | ||
| splitterModel.value = lastSplitterPosition.value; | ||
| showSidebar.value = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: snap-back logic won't work as intended - when user drags from a valid position to <10px, oldValue equals lastSplitterPosition.value (updated on line 74), so the condition oldValue !== lastSplitterPosition.value is always false
| } else if (newValue > 0 && newValue < 10 && oldValue !== lastSplitterPosition.value) { | |
| // If dragged to less than 10px, snap back to last valid position | |
| splitterModel.value = lastSplitterPosition.value; | |
| showSidebar.value = true; | |
| } else if (newValue > 0 && newValue < 10) { | |
| // If dragged to less than 10px, snap back to last valid position | |
| splitterModel.value = lastSplitterPosition.value; | |
| showSidebar.value = true; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: web/src/views/IdentityAccessManagement.vue
Line: 77:80
Comment:
**logic:** snap-back logic won't work as intended - when user drags from a valid position to <10px, `oldValue` equals `lastSplitterPosition.value` (updated on line 74), so the condition `oldValue !== lastSplitterPosition.value` is always false
```suggestion
} else if (newValue > 0 && newValue < 10) {
// If dragged to less than 10px, snap back to last valid position
splitterModel.value = lastSplitterPosition.value;
showSidebar.value = true;
```
How can I resolve this? If you propose a fix, please make it concise.91f3df3 to
04b83da
Compare
04b83da to
c798673
Compare
c798673 to
980e216
Compare
This Pr fixes the issue in #9385