Skip to content

Conversation

@nikhilsaikethe
Copy link
Contributor

This Pr fixes the issue in #9385

@github-actions github-actions bot added the ☢️ Bug Something isn't working label Dec 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

Failed to generate code suggestions for PR

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 8, 2025

Greptile Overview

Greptile Summary

This 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:

  • Added watch(splitterModel) in settings/index.vue, Functions.vue, and IdentityAccessManagement.vue to validate splitter position during dragging
  • Modified logs/Index.vue to only save splitter positions >= 1px to avoid storing micro-drag values
  • Removed manual position saving from collapseSidebar() functions

Critical Issue:
The snap-back condition oldValue !== lastSplitterPosition.value will never be true because lastSplitterPosition is updated continuously during dragging. When a user drags from 200px → 5px, the previous drag to 200px already set lastSplitterPosition = 200, so when they reach 5px, oldValue (200) equals lastSplitterPosition.value (200), causing the condition to fail. The splitter remains stuck at the invalid position, likely making the expand/collapse issue worse rather than fixing it.

Confidence Score: 0/5

  • This PR contains critical logic errors that will prevent the fix from working and may worsen the original issue
  • Score of 0 reflects that the core snap-back logic has a fundamental flaw in 3 out of 4 files - the condition will never evaluate to true, so the intended behavior cannot work. This means the PR fails to fix the reported issue and potentially introduces stuck splitter states.
  • web/src/components/settings/index.vue, web/src/views/Functions.vue, and web/src/views/IdentityAccessManagement.vue all require fixing the snap-back condition logic

Important Files Changed

File Analysis

Filename Score Overview
web/src/components/settings/index.vue 1/5 Added watcher to prevent splitter from collapsing below 10px, but snap-back condition will never trigger due to logic error
web/src/views/Functions.vue 1/5 Added watcher to prevent splitter from collapsing below 10px, but snap-back condition will never trigger due to logic error
web/src/views/IdentityAccessManagement.vue 1/5 Added watcher to prevent splitter from collapsing below 10px, but snap-back condition will never trigger due to logic error

Sequence Diagram

sequenceDiagram
    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
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile

Comment on lines +335 to +352
} 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;
Copy link
Contributor

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

Suggested change
} 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.

Comment on lines +139 to +142
} 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;
Copy link
Contributor

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

Suggested change
} 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 &lt;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.

Comment on lines +77 to +80
} 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;
Copy link
Contributor

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

Suggested change
} 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 &lt;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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

☢️ Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants