-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Feat/clean remove panel #6056
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: master
Are you sure you want to change the base?
Feat/clean remove panel #6056
Changes from 14 commits
d89a27e
c622b95
3207ce1
6d6998d
abdc962
8da5807
25c8bd0
4ba15c1
5af9bef
08f24f1
87bde30
f659d32
6a0f626
5731401
1bcb167
5aa847e
3d781cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,6 +80,14 @@ module.exports = (env, argv) => { | |
| // Hoisted Yarn Workspace Modules | ||
| path.resolve(__dirname, '../../../node_modules'), | ||
| SRC_DIR, | ||
| path.resolve(__dirname, '../pixilib/modes/gaelo-mode/node_modules'), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a custom change for your paths/setup - please don't push changes like this not for merge into master. |
||
| path.resolve(__dirname, '../pixilib/modes/learning-mode/node_modules'), | ||
| path.resolve(__dirname, '../pixilib/extensions/custom-tools/node_modules'), | ||
| path.resolve(__dirname, '../pixilib/extensions/e-learning/node_modules'), | ||
| path.resolve(__dirname, '../pixilib/extensions/gaelo-ohif-forms/node_modules'), | ||
| path.resolve(__dirname, '../pixilib/extensions/gaelo-panels-viewport/node_modules'), | ||
| path.resolve(__dirname, '../pixilib/extensions/gaelo-tmtv/node_modules'), | ||
| path.resolve(__dirname, '../pixilib/extensions/hanging-protocol-manager/node_modules'), | ||
| ], | ||
| }, | ||
| plugins: [ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -143,6 +143,20 @@ export default class PanelService extends PubSubService { | |
| this._broadcastEvent(EVENTS.PANELS_CHANGED, { position, options }); | ||
| } | ||
|
|
||
| public removePanel(panelId: string, position: PanelPosition, options): void { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Address the greptile comment about panelPosition - suggest just removing it. |
||
|
|
||
| const leftPanels = this._panelsGroups.get(PanelPosition.Left)?.map((p) => p.id) ?? []; | ||
| const rightPanels = this._panelsGroups.get(PanelPosition.Right)?.map((p) => p.id) ?? []; | ||
|
|
||
| const newLeftPanels = leftPanels.filter((id) => id !== panelId); | ||
| const newRightPanels = rightPanels.filter((id) => id !== panelId); | ||
|
|
||
| this.setPanels({ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably need to fix setPanels so that it only updates panels actually provided. That will need an update to the reset to work. |
||
| [PanelPosition.Left]: newLeftPanels, | ||
| [PanelPosition.Right]: newRightPanels, | ||
| } as any, options); | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The method signature declares a Prompt To Fix With AIThis is a comment left during a code review.
Path: platform/core/src/services/PanelService/PanelService.tsx
Line: 146-158
Comment:
**`position` parameter is declared but never used**
The method signature declares a `position: PanelPosition` argument, but the body ignores it entirely — it always reads and filters both `Left` and `Right` regardless. Any caller who passes a specific position expecting targeted removal will be confused by this silent discard. Either remove the parameter (matching the PR description's `removePanel(panelId, options = {})` signature) or use it to scope the removal to the specified position.
How can I resolve this? If you propose a fix, please make it concise.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Prompt To Fix With AIThis is a comment left during a code review.
Path: platform/core/src/services/PanelService/PanelService.tsx
Line: 146-158
Comment:
**Bottom panels are silently wiped on every `removePanel` call**
`setPanels` internally calls `this.reset()`, which clears all positions — including `Bottom`. The `removePanel` implementation only reconstructs `Left` and `Right` panels before passing them back to `setPanels`; `Bottom` panels are never read and therefore never restored. Any panel currently registered at `PanelPosition.Bottom` will be irreversibly dropped as a side-effect of removing an unrelated Left or Right panel. The fix is to include Bottom in the filter-and-restore logic (or avoid `setPanels`/`reset()` altogether and instead mutate only the target position directly).
How can I resolve this? If you propose a fix, please make it concise.
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| public addPanels(position: PanelPosition, panelsIds: string[], options): void { | ||
| if (!Array.isArray(panelsIds)) { | ||
| throw new Error('Invalid "panelsIds" array'); | ||
|
|
||
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.
false) removes the ability to debug minified production errors. The commented-out value suggests this was a temporary local tweak that was accidentally committed. Restore the original value.Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!