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

Transparent selection of Expr presenters #4

Open
Vtec234 opened this issue Apr 11, 2023 · 1 comment
Open

Transparent selection of Expr presenters #4

Vtec234 opened this issue Apr 11, 2023 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed user interface Questions about UI and UX design

Comments

@Vtec234
Copy link
Collaborator

Vtec234 commented Apr 11, 2023

As also discussed in #2, there can be many ways to present any given Expr. For example, we may choose to view it as LaTeX at one point and as a diagram at another. The UI should provide users with a choice of which view they want to see. This is currently implemented in the ExprPresentation component. Here are two stacked instances of ExprPresentation:

screenshot

Unfortunately the selection dropdown takes up space (the selection is not transparent) and means that we can't just replace the default InteractiveExpr component with this one. We should find a better UI design which takes up no space next to expressions, so that it can replace InteractiveExpr and components using it can begin displaying arbitrary Expr presentations. This may also motivate replacing the default tactic state with a ProofWidgets-based one that uses the better InteractiveExpr (or backporting enough changes to Lean core to make it work there).

A possible design would be to have a piece of global UI state and a single dropdown in a corner somewhere using which the default Expr presenter to use be chosen. Departures from the default could then perhaps be chosen via a menu appearing in the hover tooltip. Since the default @leanprover/infoview tooltip cannot be modified directly at the moment, some options would be to (A) add functionality to @leanprover/infoview to modify tooltips, or (B) copy the tooltip components over to ProofWidgets and modify them here, or (C) inject modifications dynamically using some JS hacks.

@Vtec234 Vtec234 added enhancement New feature or request help wanted Extra attention is needed user interface Questions about UI and UX design labels May 4, 2023
@Vtec234
Copy link
Collaborator Author

Vtec234 commented May 31, 2023

As of 3c2eda1, the ExprPresentation component now defaults to the first presentation returned from getExprPresentations. The plan is to combine that with user-defined precedence values (proposal) so that the most useful presentation is shown by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed user interface Questions about UI and UX design
Projects
None yet
Development

No branches or pull requests

1 participant