jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Implement better scaling of main table showing entries

Open koppor opened this issue 4 years ago • 16 comments
trafficstars

Fixes #967 so that resizing works "naturally".

Fixes https://github.com/JabRef/jabref/issues/6690

~~The only missing thing is following:~~

~~If there is additional space left the remaining columns could be broadend to use this space.~~

~~This is future work. Proposal: Additional button doing this "magic". Thus, the user has control when other than the current column should be resized.~~

~~With the current implementation, JabRef is consistent with LibreOffice Calc's behavior (and other table calculation tools).~~

~~Still open: We could not reproduce https://github.com/JabRef/jabref/issues/6690 because of https://github.com/JabRef/jabref/issues/7180~~

  • [x] Change in CHANGELOG.md described (if applicable)
  • [ ] Tests created for changes (if applicable)
  • [x] Manually tested changed features in running JabRef (always required)
  • [ ] Screenshots added in PR description (for UI changes)
  • [ ] Checked documentation: Is the information available and up to date? If not created an issue at https://github.com/JabRef/user-documentation/issues or, even better, submitted a pull request to the documentation repository.

koppor avatar Dec 12 '20 22:12 koppor

I think what you implemented was already possible before by unchecking "Entry table > Fit table horizontally on screen" in the preferences (except if I misunderstood what you were trying to do).

(Also I think one shouldn't take calculation programs as inspiration since they usually have the concept of infinitely many columns.)

tobiasdiez avatar Dec 13 '20 13:12 tobiasdiez

I think what you implemented was already possible before by unchecking "Entry table > Fit table horizontally on screen" in the preferences (except if I misunderstood what you were trying to do).

Not quite:

We implemented minimum width:

(shown in the dev call)

The "Fit table horitzontally on screen" is broken:

https://www.loom.com/share/70a2a976a5164619a03ceaa150ef2cdf

  • Columns can be shrunk until they are not visible anymore
  • Columns on the right "jump" while moving.

We are still thinking how to proceed. In my view, a "magic alignment button" setting an "optimal" cell width and then the user can adjust the widths manually is a least WTF than the current system.

For sure, we could work on something more "intelligent". I am not sure about the user experience if we are the only tool doing that way.

(Also I think one shouldn't take calculation programs as inspiration since they usually have the concept of infinitely many columns.)

Nevertheless, there JabRef typically has 15 columns.

grafik

The only tool I know with more than 10 columns is a spreadsheet application. Regarding the "Ewartungskonformität" (DIN 66234 Teil 8), this is the only thing raising expectations. Not sure whether other users also know spread sheet applications. However, I would guess so.

koppor avatar Dec 14 '20 19:12 koppor

Windows Explorer:

grafik

grafik

Double click should set the optimum width:

grafik

koppor avatar Dec 14 '20 19:12 koppor

DevCall decision:

Merge and work on column resizing afterwards. Probably with the magic button as in Windows Explorer.

koppor avatar Dec 14 '20 21:12 koppor

Well, the no-automatic-column-resizing strategy is the default one of JavaFX and can be enabled by unchecking the above checkbox. So no code changes required for this.

While I agree that the smart resizing policy has some flaws, it was working relatively well (for me and many users).

tobiasdiez avatar Dec 15 '20 13:12 tobiasdiez

Is this really the first time, I want to delete code and @tobiasdiez wants to keep it? 😇

@DominikVoigt and I worked hard to keep the smart resize. Here it is, freshly implemented in a (hopefully) smart way. Tested locally. Enjoyed it.

koppor avatar Dec 17 '20 22:12 koppor

We had some WTF moments with minwidth 10, 29. We tried with 80:

grafik

koppor avatar Dec 21 '20 21:12 koppor

I think, 10 or 15 is fine. You knows what our users put in their columns. It also makes it possible to temporarily shrink a column because it's not important for the task at hand...

tobiasdiez avatar Dec 22 '20 11:12 tobiasdiez

We hit https://stackoverflow.com/a/47860355/873282. @koppor @DominikVoigt : Look at #7209. Should be easy

Expected behavior: double click: "optimal" column width. Iterate on content an choose the maximum content length as prefWidth.

koppor avatar Jan 18 '21 19:01 koppor

We proceed as follows:

  1. @calixtus resolves merge conflicts
  2. Manual test of new system
  3. Merge
  4. Tests will come as follow up (otherwise, this won't happen until August 2021)
  5. The issue with double click on a column leading to a wrong resize will be fixed later https://github.com/JabRef/jabref/pull/7181#issuecomment-762433799
  6. Right-click on table column headers will enable "fixed" columns which should improve the UX even more
  7. Right-click on table column will allow to enable standard resize policy again (which has the effect that enlarging a column does not shrink others). This re-introduces the standard-behavior of windows explorer
  8. Right-lock on table column will offer "reaarange all columns" (because when changing from windows explorer policy to smart resize policy could lead to bad column widths)

koppor avatar Feb 01 '21 20:02 koppor

After a little bit testing, I made those observations:

  • Minimal column width is too large: my year column is three times to big at minimum size. grafik
  • Contraintuitive behaviour: if I change the width of a column, the column border is not on the same x position as my mouse cursor is. The mouse cursor seems to move in-proportionally more than the column border. grafik
  • After closing an reopening JabRef stored column widths are not reloaded

calixtus avatar Feb 06 '21 11:02 calixtus

I fixed the merge conflicts as promised, but I believe, there are probably more cleanups to do...

calixtus avatar Feb 06 '21 11:02 calixtus

After a little bit testing, I made those observations:

* Minimal column width is too large: my year column is three times to big at minimum size.

Depends on the other columns and the other columns. We decided not to add a fixed width to the year column. We hope for a context menu to have the year column fixed. IMHO 99% the users will use the fixed width, only some non-mainstream research will use more than 4 digits for a year

* Contraintuitive behaviour: if I change the width of a column, the column border is not on the same x position as my mouse cursor is. The mouse cursor seems to move in-proportionally more than the column border.

We know that. At first, it also seemed to be counter-intuitive. Later, we liked it somehow (and hoped for some feedback). -- The only possibility is to change the behavior that only columns right of the current column are resized. Maybe, this is the way to go.

* After closing an reopening JabRef stored column widths are not reloaded

Works as designed. See https://github.com/JabRef/jabref/blob/286e7f9434c681d8b5c413a619859b4b2a62154c/src/main/java/org/jabref/gui/maintable/SmartConstrainedResizePolicy.java#L66 for a reasoning.

I repeat it here

Initial table rendering

Decision to take: a) Use last setting or b) rerender with desired widths. We opt for b), because we assume that user-configuration of desired widths is easy. This leads to I3 being inconsistent to RWS2 (there is no previous width in I3).

koppor avatar Feb 07 '21 21:02 koppor

Restoring the last column widths works currently and is not something that should be controlled by the resize policy. My guess is that https://github.com/JabRef/jabref/pull/7181/files#diff-535037ff480247bb2ecacf90ae5281974308e819eb2c3eed6b5cb15931a077caR122-R125 is overwriting https://github.com/JabRef/jabref/blob/e66f5be7d82c7a7618fe327fe958ec57a25ea598/src/main/java/org/jabref/gui/maintable/columns/MainTableColumn.java#L17-L21

tobiasdiez avatar Feb 07 '21 22:02 tobiasdiez

Dev-Call decision: restore last state

calixtus avatar Feb 15 '21 19:02 calixtus

Related https://github.com/openjdk/jfx/pull/897

https://bugs.openjdk.org/browse/JDK-8293119

Siedlerchr avatar Sep 13 '22 18:09 Siedlerchr

I didn't have the time to finish it. Moving to koppor to reduce the number of PRs here. https://github.com/koppor/jabref/pull/644

koppor avatar May 07 '23 13:05 koppor