opensearch-project / OpenSearch-Dashboards

📊 Open source visualization dashboards for OpenSearch.
https://opensearch.org/docs/latest/dashboards/index/
Apache License 2.0
1.69k stars 896 forks source link

[Research] Audit typography related customizations #4258

Open BSFishy opened 1 year ago

BSFishy commented 1 year ago

Breakout issue of #4239. Audit specific places where typography terms are used: font-family, font-size, font-weight, font-style, line-height.

Result were gotten with this script: https://gist.github.com/BSFishy/6097fe241cc24f68b02bff2362df0b06

Results gist: https://gist.github.com/BSFishy/e440dabadc2a581ce349197520351946 (the results are huge and won't fit in a comment)

joshuarrrr commented 1 year ago

Initial high-level observations:

  1. Legacy stylesheets - usage unknown, the easiest mitigation is likely a branch where we remove them from https://github.com/opensearch-project/OpenSearch-Dashboards/blob/d7004dc5b0392477fdd54ac66b29d231975a173b/src/legacy/ui/ui_render/ui_render_mixin.js. We also need to understand theme and stylesheet loading more broadly.
  2. Where should OUI default font files live? Currently in OSD, not OUI (RobotoMono, InterUI). Also need more OUI docs on font handling, since it's not clear that users need to bring their own font files.
  3. https://github.com/opensearch-project/OpenSearch-Dashboards/blob/cb273364086057b542a55d2bbe28631313a22df9/src/legacy/ui/ui_render/bootstrap/template.js.hbs#L24 - Template for bootstrap script - the default error screen. Can we pull from OUI if bundling isn't guaranteed, or do we just need to hard-code to match?
  4. flot_charts usage in vis_type_timeline should be migrated to vega lite, and then flot_charts removed from https://github.com/opensearch-project/OpenSearch-Dashboards/tree/main/packages/osd-ui-shared-deps. We should also spend some time better understanding the way osd-ui-shared-deps loads OUI theming files and assets.
  5. Ace editor styles - should prefer migrating all code editor usage from monaco
  6. Tag cloud - for cases where we need in the current/in-use style values, we can retrieve them from the node they're defined on (such as body). Mitigating this component will be useful in honing our strategy for visualization styling where we often need the explicit, calculated style values.
  7. For existing plugin audit tracking issues (such as data, expressions, vis_type_timeseries), update with guidance to prioritize mitigating typographic styles. (What about monaco code editor default styling - do we need that in OUI? https://github.com/opensearch-project/OpenSearch-Dashboards/blob/cb273364086057b542a55d2bbe28631313a22df9/src/plugins/opensearch_dashboards_react/public/code_editor/README.md)
  8. Legacy maps - consult geospatial team about migration and deprecation plans
  9. Font awesome - should remove. I believe this can be taken care of as part of KUI removal (https://github.com/opensearch-project/OpenSearch-Dashboards/blob/cb273364086057b542a55d2bbe28631313a22df9/src/plugins/opensearch_dashboards_legacy/public/font_awesome/font_awesome.scss#L6)
  10. https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/plugins/opensearch_dashboards_react/public/markdown/_markdown.scss - should be added as context to opensearch_dashboards_react tracking issue. Need to better research usage to provide UX with proper context.
  11. Many old partner logos in https://github.com/opensearch-project/OpenSearch-Dashboards/tree/cb273364086057b542a55d2bbe28631313a22df9/src/plugins/home/public/assets/logos. Should we remove?
  12. Need to investigate font and style loading of https://github.com/opensearch-project/OpenSearch-Dashboards/blob/cb273364086057b542a55d2bbe28631313a22df9/src/core/server/rendering/views/template.tsx

Will re-organize and re-format soon.