Skip to content
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

refactor: openVariablePanels command and split out a PanelController #120

Merged
merged 9 commits into from
Sep 17, 2024

Conversation

bmingles
Copy link
Collaborator

@bmingles bmingles commented Sep 6, 2024

Refactored DhService to be less responsible for UI concerns

  • Defined a openVariablePanels command. This decouples opening panels from running code. It will also be used by future PR to open panels from existing server variables from the sidebar.
  • Split out a PanelController to make DhService less responsible for UI concerns.

@bmingles bmingles changed the title refactor: Split out a PanelController feat: openVariablePanels command and split out a PanelController Sep 6, 2024
Copy link

github-actions bot commented Sep 6, 2024

End-to-end Test Summary

Tests 📝Passed ✅Failed ❌Skipped ⏭️Pending ⏳Other ❓Flaky 🍂Duration ⏱️
660000004:45:41
A ctrf plugin

Detailed Test Results

NameStatusmsFlaky 🍂
should default to the correct settingspassed ✅1807
should return custom settings: Empty configspassed ✅269
should return custom settings: Populated configspassed ✅176
should be able to load VSCodepassed ✅1077
should only be visible when a supported file type is active: test.groovypassed ✅2689
should only be visible when a supported file type is active: test.pypassed ✅1027
A ctrf plugin

Failed Test Summary

No failed tests ✨

Flaky Test Summary

No flaky tests detected. ✨

@bmingles bmingles changed the title feat: openVariablePanels command and split out a PanelController refactor: openVariablePanels command and split out a PanelController Sep 6, 2024
@bmingles bmingles requested a review from mofojed September 6, 2024 17:30
@bmingles bmingles force-pushed the 116-4-panel-controller branch 2 times, most recently from f996b5c to a8f5ea9 Compare September 9, 2024 19:52
@bmingles bmingles force-pushed the 116-4-panel-controller branch from a8f5ea9 to dc6c48b Compare September 9, 2024 19:54
Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks to be good. Just some comments about TODOs and such

Comment on lines +74 to +83
// TODO: The postMessage apis will be needed for auth in DHE (vscode-deephaven/issues/76).
// Leaving this here commented out for reference, but it will need some
// re-working. Namely this seems to subscribe multiple times. Should see
// if can move it inside of the panel creation block or unsubscribe older
// subscriptions whenever we subscribe.
// panel.webview.onDidReceiveMessage(({ data }) => {
// const postMessage = panel.webview.postMessage.bind(panel.webview);
// this.handlePanelMessage(data, postMessage);
// });
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't this in the creation block above?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan to move it as part of the TODO: since it needs some other work anyway.

Comment on lines 48 to 52
// See @deprecated comment in PanelFocusManager.onDidChangeViewState
// Ensure focus is not stolen when panel is loaded
// panel.onDidChangeViewState(
// this.panelFocusManager.handleOnDidChangeViewState(panel)
// );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have a TODO or be removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deleted

const changed = [
...result!.changes.created,
...result!.changes.updated,
] as VariableDefintion[];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would satisfies VariableDefintion[] work here? Not sure why the casting is necessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately no. It complains about the mismatch of the branded ids with string ids. I added a comment.

@bmingles bmingles requested a review from mofojed September 17, 2024 20:10
@bmingles bmingles merged commit c6c871f into main Sep 17, 2024
3 checks passed
@bmingles bmingles deleted the 116-4-panel-controller branch September 17, 2024 20:26
@bmingles bmingles linked an issue Sep 18, 2024 that may be closed by this pull request
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panel Management
2 participants