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

Integrate with StructureManagerWidget from AiiDAlab-Widget-Base. #22

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

yakutovicha
Copy link

No description provided.

@superstar54 superstar54 force-pushed the feature/integrate-with-structuremanager-widget branch from 5f4722c to d5776fb Compare February 23, 2024 23:23
@superstar54
Copy link
Owner

@yakutovicha now the viewer should update when updating the atoms. Please try.

Add tests:
- generate documentation
- pure python test using pytest
- notebook test using yarn and playwright, check the official document from ipywidgets
Add tests:
- generate documentation
- pure python test using pytest
- notebook test using yarn and playwright, check the official document from ipywidgets
weas and weas-widget are separate repos, but if we want to debug/develop a new feature of weas for the widget, using bundling makes the development more convenient.

The js code was moved to the `js` folder, run `npm run build-watch` will bundle these assets into the `src/weas_widget/static` folder, and watch the changes.

## Use local weas
If we want to use the weas package, then clone the weas repo, and the two repo folders are in the same level. 

## Use release weas version
If we want to use the release version from unpkg

## Publish Python package
- Use the release version
- run `npm run build`
- python -m build
- twine upload dist/*
@superstar54 superstar54 force-pushed the feature/integrate-with-structuremanager-widget branch from 7119b9f to f1acf57 Compare March 4, 2024 19:07
@superstar54 superstar54 force-pushed the feature/integrate-with-structuremanager-widget branch from f1acf57 to 0f90bc3 Compare March 4, 2024 19:07
@superstar54 superstar54 force-pushed the feature/integrate-with-structuremanager-widget branch from 0f90bc3 to 52f5b7d Compare March 4, 2024 19:10
@superstar54 superstar54 changed the title Integrate with StructureManagerWidget from awb. Integrate with StructureManagerWidget from AiiDAlab-Widget-Base. Mar 4, 2024
js/widget.css Outdated
Comment on lines 86 to 88
select {
color: black !important; /* Or any color that provides better contrast */
}
Copy link

Choose a reason for hiding this comment

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

This will restyle all select elements on the entire page (probably not what you want, especially if others use sliders like ipywidgets). To scope these styles to just elements added by this widget, I'd recommend adding a class to the root el in render and applying a selector for select here:

function render({ model, el }) {
  /* ... */
  el.classList.add("weas-widget");
  el.appendChild(...);
}
.weas-widget > select {
  color: black;
}

Copy link

Choose a reason for hiding this comment

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

(Sorry, just passing by as I saw a mention of anywidget. Had a look at PRs to see the api usage. Feel free to ignore my unsolicited suggestion!)

Copy link
Owner

Choose a reason for hiding this comment

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

@manzt , thank you so much for taking the time to review and offer your suggestion! I've implemented the changes based on your advice. Your insight was incredibly helpful, and I appreciate it. If you have any more suggestions or feedback not only for this PR, but the widget, please feel free to share.

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.

3 participants