aiidalab / aiidalab-widgets-base

Reusable widgets for AiiDAlab applications
MIT License
6 stars 17 forks source link

Add `static` folder for static files and pre-loaded stylesheets (using new utility) #624

Open edan-bainglass opened 1 month ago

edan-bainglass commented 1 month ago

This PR adds a static folder to the widgets base package. At the moment, the folder holds stylesheets that are loaded (using a new utility function) on any import from the widgets base package.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 48.00000% with 13 lines in your changes missing coverage. Please review.

Project coverage is 83.49%. Comparing base (de5f0cc) to head (f36b9b6). Report is 1 commits behind head on master.

Files Patch % Lines
aiidalab_widgets_base/__init__.py 14.28% 12 Missing :warning:
aiidalab_widgets_base/utils/loaders.py 90.90% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #624 +/- ## ========================================== - Coverage 83.61% 83.49% -0.12% ========================================== Files 16 17 +1 Lines 3522 3539 +17 ========================================== + Hits 2945 2955 +10 - Misses 577 584 +7 ``` | [Flag](https://app.codecov.io/gh/aiidalab/aiidalab-widgets-base/pull/624/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | Coverage Δ | | |---|---|---| | [python-3.11](https://app.codecov.io/gh/aiidalab/aiidalab-widgets-base/pull/624/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `83.49% <48.00%> (-0.12%)` | :arrow_down: | | [python-3.9](https://app.codecov.io/gh/aiidalab/aiidalab-widgets-base/pull/624/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `83.53% <48.00%> (-0.12%)` | :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=aiidalab#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.

edan-bainglass commented 1 month ago

@danielhollas thanks for your comments. Let's discuss further on Discourse.

edan-bainglass commented 6 days ago

@danielhollas I think I'll keep SCSS local and only commit/use the CSS files. In other words, no extra compilation step required for the developer if they wish to only work in CSS. Will update the PR shortly.

edan-bainglass commented 1 day ago

@danielhollas could you please take a look at why the browser tests are failing? I'm not sure I understand what's happening here.

danielhollas commented 1 day ago

@edan-bainglass The same failures are seen on the main branch so it is not related to this PR.

edan-bainglass commented 1 day ago

@danielhollas I see. Okay then. Please review 🙏🏻 I have a few PRs built on top of this one both here and in the QE app. I think all is well other than the tests. I've removed the SCSS part.

danielhollas commented 1 day ago

Matter of fact, I could use a test case for a notebook test, as recommended by @superstar54.

Yep! :+1:

So to clarify, the bit of code you mentioned (df styles) can be removed once I add it via css, correct?

That would be my expectation, yes! By the way, please don't use the df class as a selector, since it comes from pandas I believe and I am planning to substitute pandas for tabulate in near future. Please add a custom awb class for this.

edan-bainglass commented 1 day ago

@danielhollas proceeding with a made-up class for testing purposes only, as to not interfere with the code base for now.

edan-bainglass commented 1 day ago

I think this is good now? Failed tests unrelated I believe.