-
Notifications
You must be signed in to change notification settings - Fork 13
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
Allow to freeze content of a memory view instance #83
Allow to freeze content of a memory view instance #83
Conversation
Add a button in the title bar that allows to freeze the current content of the memory view. If the view is frozen, updates from the debug adapter are ignored and don't overwrite the shown data. In addition, UI elements that would trigger a data change (core options widget, `load more memory` buttons) are disabled. Closes eclipse-cdt-cloud#70
ebbc469
to
67b8796
Compare
media/options-widget.css
Outdated
@@ -57,6 +65,11 @@ | |||
border-top: 1px solid var(--vscode-widget-border); | |||
} | |||
|
|||
.core-options input:disabled, |
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.
Could you please move the input:disabled
changes to https://github.com/eclipse-cdt-cloud/vscode-memory-inspector/blob/main/media/theme/components/input.css so that we can use it everywhere?
and also use the css cursor: not-allowed;
please for the input and button when they are disabled.
Maybe you will also need to update: https://github.com/eclipse-cdt-cloud/vscode-memory-inspector/blob/main/media/theme/extensions.css
.pm-top-label .p-inputtext-label {
margin-bottom: 2px;
}
.pm-top-label:not(:has(*:disabled)) .p-inputtext-label {
cursor: pointer;
}
.pm-top-label:has(*:disabled) {
cursor: not-allowed;
}
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.
An alternative to the cursor changes would be simply not to render the 'load more' headers / footers when those options aren't available. But one of the two changes should be made - at the moment, we still show the pointer cursor over the headers, even though they can't be interacted with.
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.
@haydar-metin The css has been adjusted. Instead of adjusting the disabled
styling for individual components i opted for
defining the disabled style globally for all prime react/custom components:
.p-disabled,
.p-disabled * {
pointer-events: auto;
cursor: not-allowed;
color: var(--vscode-disabledForeground);
}
This ensures that all disabled components have the same default styling.
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.
Functionality looks generally good; only minor comments.
@@ -33,6 +33,8 @@ interface MemoryWidgetProps extends MemoryDisplayConfiguration { | |||
refreshMemory: () => void; | |||
updateMemoryArguments: (memoryArguments: Partial<DebugProtocol.ReadMemoryArguments>) => void; | |||
toggleColumn(id: string, active: boolean): void; | |||
isFrozen: boolean; | |||
toggleFreezeButton: () => void; |
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.
toggleFreezeButton: () => void; | |
toggleFrozen: () => void; |
media/options-widget.css
Outdated
@@ -57,6 +65,11 @@ | |||
border-top: 1px solid var(--vscode-widget-border); | |||
} | |||
|
|||
.core-options input:disabled, |
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.
An alternative to the cursor changes would be simply not to render the 'load more' headers / footers when those options aren't available. But one of the two changes should be made - at the moment, we still show the pointer cursor over the headers, even though they can't be interacted with.
src/webview/memory-webview-view.tsx
Outdated
protected toggleFreezeButton = (): void => { this.doToggleFreezeButton(); }; | ||
protected doToggleFreezeButton(): void { | ||
this.setState(prevState => ({ ...prevState, isFrozen: !prevState.isFrozen })); | ||
} |
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.
These names sound more like they toggle the visibility of the button rather than the state itself.
- Adapt css styles to ensure consistent styling for disabled component (cursor and color) - Rename `toggleFrozenButton` to `toggleFrozen`
Thanks for the reviews! |
Thanks everyone! Functionality looks indeed good! |
Yes, while frozen memory fetching is globally disabled, so in theory this should also disabled auto-append. |
@tortmayr @jreineckearm Not that I'm aware of, as @tortmayr disabled the fetching completely. To be sure, I will test it again after merging. |
Thanks! |
What it does
Add a button in the title bar that allows to freeze the current content of the memory view. If the view is frozen, updates from the debug adapter are ignored and don't overwrite the shown data. In addition, UI elements that would trigger a data change (core options widget,
load more memory
buttons) are disabled.Closes #70
How to test
Click the freeze-button (lock icon) in the title bar
Trigger memory updates (e.g by stepping in the debugger). Check that memory content remains unchanged
Unfreeze view and trigger updates. Memory content should update again.
Review checklist
Reminder for reviewers