concord-consortium / codap

CODAP (Common Online Data Analysis Platform)
MIT License
94 stars 38 forks source link

chore: simplify ComponentTitleBar #1389

Closed kswenson closed 1 month ago

kswenson commented 1 month ago

After the last round of ComponentTitleBar and getTitle refactoring, we ended up in a situation in which:

  1. Every component provides a CustomTitleBar which passes a getTitle prop to ComponentTitleBar.
  2. Every CustomTitleBar component passes the same global getTitle function as its getTitle prop.

The purpose of passing the getTitle function to the ComponentTitleBar originally was so that CustomTitleBar implementations could provide their own component-specific means of retrieving the title in a way that would allow the access of the title to occur in the ComponentTitleBar so that only it would re-render when the title changed. Once the getTitle customization moved from the component to the registration, there's no need for the getTitle prop at all. This allows components that don't require title bar customization, e.g. graph, map, and the upcoming text component (which is what got me here in the first place) to use the default ComponentTitleBar without customization.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 85.79%. Comparing base (70fb260) to head (188046f). Report is 4 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1389 +/- ## ========================================== + Coverage 85.59% 85.79% +0.19% ========================================== Files 527 525 -2 Lines 25840 25823 -17 Branches 6612 7045 +433 ========================================== + Hits 22119 22154 +35 + Misses 3566 3390 -176 - Partials 155 279 +124 ``` | [Flag](https://app.codecov.io/gh/concord-consortium/codap/pull/1389/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=concord-consortium) | Coverage Δ | | |---|---|---| | [cypress](https://app.codecov.io/gh/concord-consortium/codap/pull/1389/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=concord-consortium) | `72.40% <100.00%> (+0.22%)` | :arrow_up: | | [jest](https://app.codecov.io/gh/concord-consortium/codap/pull/1389/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=concord-consortium) | `53.69% <75.00%> (-0.02%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=concord-consortium#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

cypress[bot] commented 1 month ago



Test summary

200 0 29 0Flakiness 0


Run details

Project codap-v3
Status Passed
Commit c86ce9dc92
Started Aug 8, 2024 10:13 PM
Ended Aug 8, 2024 10:22 PM
Duration 09:06 💡
OS Linux Ubuntu -
Browser Chrome 127

View run in Cypress Cloud ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Cloud