Repository navigation
Reduce layout jump of tags editors - #17555
Conversation
|
Hey @NoureddineCH1! 👋 Thank you for contributing to JabRef! We have automated checks in place, based on which you will soon get feedback if any of them are failing. We also use Qodo for review assistance. It will update your pull request description with a review help and offer suggestions to improve the pull request. After all automated checks pass, a maintainer will also review your contribution. Once that happens, you can go through their comments in the "Files changed" tab and act on them, or reply to the conversation if you have further inputs. You can read about the whole pull request process in our contribution guide. Please ensure that your pull request is in line with our AI Usage Policy and make necessary disclosures. |
|
The "Unit tests (Windows) (jablib)" job failed because embedded Postgres was not unpacked within 60 seconds (SqlBasedLibrarySearcherWithBibFilesTest). The JBang check also failed on a dependency download. My change only touches TagsEditor in jabgui, so these look unrelated. Could a maintainer re-run the failed jobs? |
|
I reran the tests now and see if it works now. Probably some github hiccup |
PR Summary by QodoReduce entry editor layout jumps for groups and keywords
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. Editor height may stay one row high after tags wrap
|
|
Successfully created backport PR for |
…n-list * upstream/main: (74 commits) Reduce layout jump of tags editors (#17555) [Port to main] Chore(deps-dev): Bump @modelcontextprotocol/server from 2.0.0 to 2.4.0 (#17670) Make arXiv fallback title matching locale independent (#17652) Chore(deps): Bump org.eclipse.jgit:org.eclipse.jgit.ssh.apache.agent from 7.8.0.202609011348-r to 7.8.1.202611041320-r in /versions (#17726) Chore(deps): Bump org.eclipse.jgit:org.eclipse.jgit from 7.8.0.202609011348-r to 7.8.1.202611041320-r in /versions (#17727) Chore(deps): Bump org.eclipse.jgit:org.eclipse.jgit.ssh.apache from 7.8.0.202609011348-r to 7.8.1.202611041320-r in /versions (#17728) Chore(deps): Bump com.dlsc.gemsfx:gemsfx from 4.6.0 to 4.7.0 in /versions (#17729) New Crowdin updates (#17725) chore(deps): update dependency com.nimbusds:oauth2-oidc-sdk to v11.39 (#17723) Fix numeric sorting for citationcount, day, and dayfiled columns (#17649) Preserve syntax highlighting when copying BibTeX in Source tab (#17392) (#17441) Chore(deps): Bump com.dlsc.gemsfx:gemsfx from 4.5.0 to 4.6.0 in /versions (#17721) Chore(deps): Bump com.konghq:unirest-java-core from 4.11.2 to 4.11.3 in /versions (#17719) Chore(deps): Bump org.graalvm.sdk:nativeimage from 25.4.4.1.1 to 25.5.5.0.3 in /versions (#17718) Chore(deps): Bump com.konghq:unirest-modules-gson from 4.11.2 to 4.11.3 in /versions (#17720) New Crowdin updates (#17715) chore(deps): update dependency org.eclipse.jgit:org.eclipse.jgit.pgm to v7.8.1.202611041320-r (#17712) Restrict consistency check columns to the fields of a .bst style (#17710) Remove OCR language handling from DoclingEngine (#17674) Exclude "file" field from consistency check (#17651) ...
Summary
The entry editor flickered when switching between entries that have a tags field (groups, keywords). While a TagsField has no width yet, GemsFX's FlowPane puts every tag on its own row, so TagsEditor first reported a height of about one row per tag (115 px for 4 tags) and then dropped to 27 px once the field got its width. A new editor is created on every entry change, so this jump happened on every click.
TagsEditor now reports the height of a single row (minimum and preferred height) until the TagsField has a width. For 4 tags, the initial height goes from 115 px to 22.5 px. A slight residual flicker remains; I could not identify its cause (ruled out: entry preview, scroll bar policy, initial placement of the tags).
This is a draft. Next step: find the cause of the residual flicker, and report the FlowPane behaviour to GemsFX.
Steps to test
groupsfield with at least 4 comma-separated groups, for examplegroups = {a, b, c, d}.Related issues and pull requests
Closes #17229
AI CHECKLIST.md walkthrough
1. Code self-review
Nullability and control flow
== null/!= nullchecks — JSpecify annotations (@NullMarked,@Nullable,@NonNull) used instead.Objects.requireNonNull(...)— nullability expressed via JSpecify annotations.@NullMarked(org.jspecify.annotations.NullMarked).@NullMarked(org.jspecify.annotations.NullMarked).Optionalconsumed withifPresent/ifPresentOrElse/map/orElseThrow— neverorElse(unusedValue)nor anisPresent()+get()block.StringUtil.isBlank(...)used instead ofs == null || s.isBlank().Exceptions
catch (Exception e)— only specific exceptions are caught.throw new RuntimeException(...)/IllegalStateException(...)— these tear down the whole application.LOGGER.info("...", e)), not concatenated into the message string.Style and idioms
BibEntryobjects built with withers (withField, notsetField).List.of()/Map.of()/Set.of(),Path.of(),SequencedCollection/SequencedSet, text blocks.Pattern.compile(...)constant, notString.matches(...).org.jabref.logic.util.BackgroundTask, notnew Thread().///) uses Markdown syntax, not JavaDoc inline tags:`code`instead of{@code},[ClassName]instead of{@link}.User-facing text
Localization.langin Java,%prefix in FXML).!; labels do not end with:."...: %0"), not string concatenation.Security
text/htmlresponse — including exception/error messages, not just the success body (XSS).Tests
org.jabref.model/org.jabref.logichave added or updated tests.assertEquals), use plain JUnit asserts (not AssertJ), have no@DisplayName, do not catch exceptions (let them propagate so JUnit reports setup/teardown failures directly), and use@TempDirinstead of manual temp directories.2. Verification commands
./gradlew :jablib:check(or./gradlew checkfor all modules)../gradlew checkstyleMain checkstyleTest checkstyleJmh../gradlew modernizer../gradlew --no-configuration-cache :rewriteDryRunreports no changes (run./gradlew rewriteRunto fix)../gradlew javadoc.npx markdownlint-cli2 "docs/**/*.md" "*.md"(only if Markdown changed).npm ci && npm run textlintreports no misspellings (only if Markdown changed).rewriteRun:docker run -v $(pwd):/github/workspace ghcr.io/leventebajczi/intellij-format:master "*.java" "" ".idea/codeStyles/Project.xml".3. Documentation
CHANGELOG.mdentry added if the change is visible to the user (end-user wording, no extra blank lines, sorted in next to existing entries about the same component/feature). Link the issue if one exists; link the PR only when no issue exists. UseTODOas the placeholder when neither is known yet — never a fake number. No entry for fixes to changes that were themselves introduced after the last release (feature only in## [Unreleased]) — update the existing unreleased entry instead if needed.TODO(nocloses/fixesfor merely-similar issues).docs/requirements/<area>.mdif the change is a new feature or significant bug fix (skip for refactors, minor fixes, and internal changes).docs/updated if behavior or architecture changed.4. Pull request
.github/PULL_REQUEST_TEMPLATE.md, every section filled.[x],[ ], or[/].gh pr create --body-file <file>(not--body).CHANGELOG.mdused aTODOplaceholder (no issue confidently identified yet — an existing issue link always stays), the PR was opened as draft, the placeholder was replaced with the real PR-number link after PR creation, committed and pushed, and only then was the PR marked ready for review. If an issue is identified or created later, the link is switched to the issue.Checklist
CHANGELOG.mddescribing the change from the user's point of view (if the change is visible to the user)