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

Add panel feature #78

Open
wants to merge 110 commits into
base: feature/draggable
Choose a base branch
from
Open

Add panel feature #78

wants to merge 110 commits into from

Conversation

aatng-gh
Copy link
Contributor

@aatng-gh aatng-gh commented Aug 1, 2022

Description

Add usePanel extension
image

Type of change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Jest
  • Visually tested

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Aaron Nguyen and others added 30 commits June 7, 2022 13:58
* Hardcode dropzone-layer

* Create basic functionalities

* Add identifiable class to x-dot

* Add data-gate-id & data-gate-wire

* Extract _getCenter

* Add events

* Change function names

* Add move & copy

* Fix edge cases

* Add offset recursively on wires

* Hold Ctrl to copy

* Extra stuffs

* Let onCircuitChange taking in circuit object

* Add partial support for group gates

* Remove unnecessary function
@codecov-commenter
Copy link

codecov-commenter commented Aug 1, 2022

Codecov Report

❗ No coverage uploaded for pull request base (feature/draggable@d559585). Click here to learn what that means.
The diff coverage is n/a.

@@                 Coverage Diff                  @@
##             feature/draggable      #78   +/-   ##
====================================================
  Coverage                     ?   89.05%           
====================================================
  Files                        ?        4           
  Lines                        ?      265           
  Branches                     ?       33           
====================================================
  Hits                         ?      236           
  Misses                       ?       18           
  Partials                     ?       11           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@anjbur
Copy link

anjbur commented Aug 3, 2022

Looking good! I found some bugs, some of which should be fixed now and some can be triaged as issues for later.

Higher priority:

  • I currently can't move measurement gates between wires, but they should have vertical movement enabled
  • In Example 1, if I move the CNOT gate to have target q0 and control q1, then if I accidentally click the portion of the gate on q0 that overlaps with the right hand drop zone, the gate is moved to the far right end of the circuit.

Lower priority:

  • The EDIT panel stops working if you switch directly from one gate to another without switching back to the ADD panel in between. It should either work for the new gate or automatically revert to the ADD panel. Couldn't reproduce later when meeting, so dropping this to a lower priority for later investigation.
  • To exit the EDIT panel and move back into ADD, it only works to click inside the circuit. Ideally, the user could click anywhere on the page to return to the ADD panel. At the least, clicking the Esc key should return the user to the ADD panel.
  • In the ADD panel, just clicking on a gate gives you a shadow that you can move around, but you can't actually add it to the circuit. Either you should be able to use this as usual or a single click (as opposed to click and drag) shouldn't create a gate shadow.
  • When moving a multi-qubit gate or a single qubit gate with a control bit, it would be nice if there was a way to move it so it stays in its position on the current wire but moves before/after gates on other wires. For example, on Example 1 the only way to swap the H and CNOT gates is to move the CNOT to q0 and then back to q1. It would be nice if this could be done in a single horizontal movement.
  • Adding and moving gates doesn't interact properly with the classical logic section of the circuit. On Example 2, placing a gate on the drop zone adjacent to the classically controlled section actually puts it inside that section (if there are gates on that wire. If there are no gates on that wire inside the classical section, then it automatically puts the gate after the classical section. There should be an option to put it before or after in either case).
  • When a button to expand/collapse a group overlaps with a drop zone, that button can't be clicked.
  • In Example 2, in the portion after the classical section, there's a group of gates: ZZ, ZZ, XX, XX, XX. If I move the second ZZ gate down one wire, it moves it down and swaps it horizontally with the adjacent gate resulting in: ZZ, XX, ZZ, XX, XX. This works in general, so I’m not sure why this particular example shows this behavior.

@aatng-gh aatng-gh marked this pull request as ready for review August 11, 2022 15:21
@aatng-gh aatng-gh requested a review from anpaz August 11, 2022 15:21
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