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

[Feature]: Visualization of empty groups #1815

Open
ichibha opened this issue Feb 8, 2023 · 4 comments
Open

[Feature]: Visualization of empty groups #1815

ichibha opened this issue Feb 8, 2023 · 4 comments
Assignees
Labels
feature Request for a new feature or functionality, as opposed to a defect in an existing feature.

Comments

@ichibha
Copy link

ichibha commented Feb 8, 2023

This issue is derived from #1812 . It is useful if the following function is implemented: displaying something for empty groups to clarify their existence.

@ichibha ichibha changed the title Visualization of empty groups [Feature]: Visualization of empty groups Feb 8, 2023
@arnog arnog self-assigned this Feb 8, 2023
@arnog arnog added the feature Request for a new feature or functionality, as opposed to a defect in an existing feature. label Feb 8, 2023
@scytacki
Copy link

Hi @arnog I'm working with @dennisrcao on this. Is this concord-consortium#2 a good place to add a visualization of empty groups?

@arnog
Copy link
Owner

arnog commented May 27, 2023

Great! Thanks for looking into this. Here’s how I would approach this:

  • modify Box.toMarkup() to add a class (ML_empty-group?) if the group is empty and does not contain the caret (if the caret is in an empty group I would just do nothing since at that point the caret makes it clear where you are. The point of making empty groups visible is to draw attention to them when they could otherwise be invisible and difficult to click on)
  • Have that class do some styling like setting a minimum width/height, and perhaps a background color. The class should only be active if the mathfield has the focus
  • Trigger that behavior off a new configuration option

@scytacki
Copy link

To clarify, are you saying we should not identify the empty group in createBox and instead identify it in toMarkup?

It seemed to me that identifying in createBox was better since it is closer to the "model".
Identifying it in toMarkup meant looking for a box that had no siblings, no children, and had an id. The last two parts are easier in createBox because we can just look for a first atom. After identifying this atom, the createBox function could return a box with a property indicating it is a empty group (or a new subclass of Box could be used). So then toMarkup could add the class to it.

@arnog
Copy link
Owner

arnog commented May 28, 2023

You’re right, you still need to identify it as an empty group, and createBox is the best place for it. I would either create a Box subclass, or you might just be able to create a Box with a custom class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Request for a new feature or functionality, as opposed to a defect in an existing feature.
Projects
None yet
Development

No branches or pull requests

3 participants