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

feat: Add option to disable WebGL rendering #2134

Merged
merged 5 commits into from
Jul 11, 2024

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented Jul 8, 2024

  • Advanced Settings section in the Settings menu, with an option to disable WebGL
  • Read from the server config for default values
    • web.webgl: default setting for WebGL being enabled or not
    • web.webgl.editable: disallow the user from enabling WebGL
  • Contextual Help item to add more info
  • Tested by adding the following to the deephaven.prop config:
web.webgl=false
web.webgl.editable=false
client.configuration.list=java.version,deephaven.version,barrage.version,http.session.durationMs,file.separator,web.storage.layout.directory,web.storage.notebook.directory,web.webgl,web.webgl.editable

Screenshot of when it's enabled/editable:
image

Screenshot of when it's disabled/editable (@dsmmcken I think we may need to change Switch styling up here, or the Settings menu background):
image

Screenshot of when it's disabled and not editable on the server:
image

- Advanced Settings section in the Settings menu, with an option to disable WebGL
- Read from the server config for default values
  - web.webgl: default setting for WebGL being enabled or not
  - web.webgl.editable: disallow the user from enabling WebGL
- Tested by adding the following to the deephaven.prop config:
```
web.webgl=false
web.webgl.editable=false
client.configuration.list=java.version,deephaven.version,barrage.version,http.session.durationMs,file.separator,web.storage.layout.directory,web.storage.notebook.directory,web.webgl,web.webgl.editable
```
@mofojed mofojed requested a review from dsmmcken July 8, 2024 20:00
@mofojed mofojed self-assigned this Jul 8, 2024
@mofojed mofojed marked this pull request as ready for review July 8, 2024 20:00
Copy link

codecov bot commented Jul 8, 2024

Codecov Report

Attention: Patch coverage is 22.50000% with 31 lines in your changes missing coverage. Please review.

Project coverage is 46.62%. Comparing base (989b8ec) to head (c477869).
Report is 6 commits behind head on main.

Files Patch % Lines
...ode-studio/src/settings/AdvancedSectionContent.tsx 0.00% 11 Missing ⚠️
packages/chart/src/Chart.tsx 0.00% 10 Missing ⚠️
packages/chart/src/ChartUtils.ts 44.44% 5 Missing ⚠️
packages/chart/src/FigureChartModel.ts 25.00% 3 Missing ⚠️
packages/chart/src/ChartModel.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2134      +/-   ##
==========================================
+ Coverage   46.59%   46.62%   +0.02%     
==========================================
  Files         682      685       +3     
  Lines       38441    38489      +48     
  Branches     9578     9590      +12     
==========================================
+ Hits        17912    17945      +33     
- Misses      20519    20534      +15     
  Partials       10       10              
Flag Coverage Δ
unit 46.62% <22.50%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@dsmmcken dsmmcken left a comment

Choose a reason for hiding this comment

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

theme-spectrum-overrides.css

span[class*='spectrum-ToggleSwitch-switch'] {
  /* increase contrast of switch in off position */
  background: var(--dh-color-gray-500);
}

@dsmmcken
Copy link
Contributor

dsmmcken commented Jul 9, 2024

Is there a follow on ticket for deephaven-express to check this setting?

@mofojed
Copy link
Member Author

mofojed commented Jul 9, 2024

@dsmmcken followup ticket: deephaven/deephaven-plugins#612

- The Off position blended with the background too much. Add an override so it does not
@mofojed mofojed requested a review from dsmmcken July 9, 2024 17:51
dsmmcken
dsmmcken previously approved these changes Jul 9, 2024
@mofojed mofojed requested a review from bmingles July 10, 2024 21:28

span[class*='spectrum-ToggleSwitch-switch'] {
/* increase contrast of switch in off position */
background: var(--dh-color-gray-500);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we introduce a --dh-toggle-switch-bg: var(--dh-color-gray-500) to make this overridable?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't see why not? @dsmmcken

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, and actually should double check it in light mode, as I didn't.

Should be added to theme-dark-components.css and theme-light-components.css with appropriate values, that use that variable here.

*/
getPlotlyChartType(
plotStyle: DhType.plot.SeriesPlotStyle,
isBusinessTime: boolean
isBusinessTime: boolean,
allowWebGL: boolean
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be mentioned as a BREAKING CHANGE?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll just default it to true to avoid making it a breaking change. I wanted to make sure I caught all the places where it was called from though.

@@ -1019,7 +1025,8 @@ class ChartUtils {

getChartType(
plotStyle: DhType.plot.SeriesPlotStyle,
isBusinessTime: boolean
isBusinessTime: boolean,
allowWebGL: boolean
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be mentioned as a BREAKING CHANGE?

Copy link
Contributor

@bmingles bmingles left a comment

Choose a reason for hiding this comment

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

Left a couple of suggestions / questions

- Use typed useSelector
- Add css variable for toggle switch background
Copy link
Contributor

@bmingles bmingles left a comment

Choose a reason for hiding this comment

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

1 issue with location of the css variable, but otherwise looks good.

bmingles
bmingles previously approved these changes Jul 11, 2024
Copy link
Contributor

@bmingles bmingles left a comment

Choose a reason for hiding this comment

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

LGTM

@dsmmcken dsmmcken requested a review from bmingles July 11, 2024 20:56
Copy link
Contributor

@bmingles bmingles left a comment

Choose a reason for hiding this comment

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

LGTM

@mofojed mofojed enabled auto-merge (squash) July 11, 2024 21:00
@mofojed mofojed merged commit 011eb33 into deephaven:main Jul 11, 2024
11 checks passed
@mofojed mofojed deleted the disable-webgl branch July 11, 2024 21:16
@github-actions github-actions bot locked and limited conversation to collaborators Jul 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants