gaphor / gaphor

Gaphor is the simple modeling tool
https://gaphor.org
1.87k stars 200 forks source link

Cannot create the first attribute in a class using keyboard only #2155

Closed jaragunde closed 10 months ago

jaragunde commented 1 year ago

Describe the bug

On class diagrams, when you have a class selected, you can press tab to navigate through the fields of the side bar. Normally, you would be able to tab into the "attributes" and "operations" sections, press enter and type a name to create one, but this doesn't work if there are no attributes or operations in the list already.

To Reproduce

Steps to reproduce the behavior:

  1. Create a class diagram
  2. Create a new class
  3. Enter a name
  4. Press tab multiple times until you focus the attributes list in the right area
  5. Press enter, focus marker just disappears

Message from (top-right menu) → ToolsError Reports:

Gaphor version:    2.17.0
Operating System:  Linux (6.1.18-200.fc37.x86_64)
Python version:    3.10.6
GTK version:       4.8.3
Adwaita version:   1.2.2
PyGObject version: 3.42.2
Pycairo version:   1.23.0
Cairo version:     1.16.0
Pango version:     1.50.12
Display:           GdkWaylandDisplay

No errors have been intercepted. We’re good.

Expected behavior

After you press enter, a text box should appear for you to type an attribute name, but it doesn't. You need to use the mouse to click on that widget for this to happen.

Notice that the bug doesn't happen if there are already some attributes. In that case, you may use arrow keys to navigate through the existing attributes, reach the last row and press enter to create a new one.

This is also reproducible for class operations.

Screenshots

If applicable, add screenshots to help explain your problem.

OS

Version

Version of Gaphor: 2.17.0

Additional information

Using Fedora Linux 37 (Workstation Edition), GNOME 43.3, Wayland

amolenaar commented 1 year ago

Hi @jaragunde, thank you for this issue report. Indeed, I would expect tab navigation to just work.

The widget we use at the moment is coming from GTK 3. We want to upgrade those to GTK 4. It would be good to check if tab navigation works okay then.

jaragunde commented 1 year ago

Thanks for writing back! It makes sense to get widgets upgraded first, I'll keep checking.

amolenaar commented 1 year ago

See also #2231.

mikekidner commented 1 year ago

@jaragunde / @amolenaar / @danyeaw I've found that you can create attributes without having to use the mouse to click. As above; In the UML profile create the class using the "C" shortcut.
Name the class hit "Enter" Tab through until focus is in the attribute box - Hit Enter - type the attribute name - hit "Enter" again press the down arrow, hit "Enter" Type name of next attribute, hit "Enter". etc....

Maybe not as intuitive as it could be. Were the GTK widgets updated since this was reported?

amolenaar commented 1 year ago

The GTK widgets have not been updated. I did update the Activity Parameters, but that resulted in application crashes, so those changes have been reverted.

amolenaar commented 10 months ago

This mostly works now. All tables have been updated to new ListView widgets.

The F2 key is now used to start editing (same as model browser).

danyeaw commented 10 months ago

@all-contributors please add @jaragunde for bug

allcontributors[bot] commented 10 months ago

@danyeaw

I've put up a pull request to add @jaragunde! :tada:

jaragunde commented 9 months ago

Thanks!