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

Support editable sections in display widgets #13

Merged
merged 40 commits into from
Jan 20, 2023

Conversation

skieffer
Copy link
Member

Makes it so that, within the build code for a display widget, any number of sections of the form,

# BEGIN EDIT
...
# END EDIT

may be added, and all code appearing inside such sections will be user-editable in notes panels.

Each section gets a separate editor, with a "Build" button, and a "Reset" button.

The editors appear above the display. The editor area has yellow bg (like parameter widgets), while the display area still has blue bg (as before). This maintains a consistent color coding for input vs output areas.

Probably we want some new commands in the management code
to help with this...
Now, when a widget has an error, we still try to rebuild any widgets in the
sequence that are *not* descendants of this one.

To illustrate what the problem was with the existing design,
suppose B and C depend on A, but are independent of each other.
Suppose A has changed, causing an error in B, but C is still fine.
If we give up as soon as we detect the error in B, then C will still be
grayed out. And if we later update B to work with the new value of A,
then, since C is *not* a descendant of B, this update will fail to un-gray C.
C will still look disabled, even though it was always fine.

Under the new design, we note the error in B, but we continue to rebuild C.
ParamWidget doesn't need to declare and initialize its `listeners` property.
A ParamWidget is an ExampWidget is a Widget, and the latter already handles
all this. Every Widget subclass accepts listeners.
Maybe `liveInfo` shouldn't be used at all anymore.
This seems to just be a remnant from when we had checkmarks making
auto updates to ChartWidgets.
* We now get an editor for each ediable section of a disp widget.
* Can use Ctrl-B from an editor to rebuild the disp widget.
* Refactored, moving a bunch of stuff out of EditManager and moving it to util.js,
  so that DispWidget can now also use it.
We use this instead of the `ds` scroll adjustment solution from last commit.
That was making the resizing a little bit difficult to control, since it would
suddenly accelerate when the scroll offset began to take effect.

Now we simply show a resize ghost, and do not actually adjust the size of
the editor until mouseup.
When a `DispWidget` observes a closing panel, it has to first check
whether it has any presence in that panel, before it tries to iterate over
editors.
* max
* min

* binomial
* latex() on a Matrix
* EvalfMixin.evalf
* Expr.expand
* Expr.subs
* Matrix.transpose
Make a `DispWidget.activateEditorPanel()` method, to
make `DispWidget.activate()` more compact.
* Use `pre` tag, so newlines render
* Show both original and current values
This is so the `val()` method can return the newly updated code
when it is invoked by `ExampWidget.activate()`. This means now
updates show up immediately on reload of an existing notes panel
(instead of having to wait for the first rebuild via parameter choice,
as was happening up to now).
The logic for trying the two cases was wrong.
We would always carry out the second case, regardless of
what happened in the first.
Up to now, we were not actually doing *anything* with the `exports` field.

Now the rule is: if undefined, all vars are exported. If a list (including empty),
only the listed vars are exported.
* Switch to use of setup.cfg
* Use invoke instead of make
* Advance version numbers
Shutting off support for server-side math jobs, to remove RQ from the process when running unit tests.
Was getting some pickling error with SymPy types:

_pickle.PicklingError: Can't pickle <functools._lru_cache_wrapper object at 0x107eca1f0>: it's not the same object as sympy.core.expr.Expr.expand
It was considered that maybe the pfsc-examp project should become a subproject of pise;
however, it seems better that their version numbers be free to vary independently.
So, instead of making an actual examp dir, we could have used `git submodule` for this
topic branch. We now remove the directory, after adding these changes to the pfsc-examp repo
itself.
@skieffer skieffer added the enhancement New feature or request label Jan 19, 2023
@skieffer skieffer merged commit 01b2f53 into proofscape:main Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant