Skip to content

OpenConceptLab/ocl_issues#3074 | Reference result tables draw their border and wrap at phone width; Transform names the kept references - #116

Merged
snyaggarwal merged 7 commits into
mainfrom
ocl_issues-3074-display-fixes
Nov 29, 2026
Merged

snyaggarwal merged 7 commits into
mainfrom
ocl_issues-3074-display-fixes

Conversation

@snyaggarwal

@snyaggarwal snyaggarwal commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

TBv3 part of item 3 of OpenConceptLab/ocl_issues#3074 (epic OpenConceptLab/ocl_issues#2942), following #109. The API part is OpenConceptLab/oclapi2#1073, which makes the "resolved to nothing" message say why and how to fix it.

The four display points

1. The message column is cut off at phone width.

  • The cause: the long version URL in the API's message can't break, so the table grew wider than the dialog.
  • The fix: the tables now use a fixed layout, and their cells wrap anywhere.
  • At phone width the reference column is 30% wide instead of 40%.

2. The warning border doesn't draw.

  • The cause: a <table> with collapsed borders and overflow: hidden doesn't draw its own border. The same is true of the failed table's red border.
  • The fix: a new ReferenceResultsTable frames the table in a box that carries the border and the rounded corners.
  • It's used for the saved-but-added-nothing table and for the failed table, in both Add References and Add to Collection.
  • The last row's divider is dropped, so it doesn't double the frame.

3. A reference the parameters exclude was summarised as "resolved to nothing".

  • The summary line now reads "N saved but added nothing", which matches the table header ("Saved, but nothing added").
  • That's true of both cases: a reference that resolved to nothing, and one whose members the expansion's parameters exclude.
  • The API's own message, shown in the row, still says which case it is.

4. Transform when nothing resolved.

  • Before: it showed a red error and kept the dialog open, although the replacements were removed and every original was kept.
  • Now: it shows a warning, closes the dialog and clears the selection.
  • Both alerts name the kept references: the "none resolved" alert and the partial one list the original references they kept. They list them by expression, with slashes intact: the first five, then "and N more".

Older points from the ticket

Wording for Jon

  • Summary line: "N saved but added nothing", in place of "N saved but resolved to nothing".
  • Transform alerts: each ends with ": ". The none-resolved alert now says the originals "were kept" (it said "left unchanged"). Every locale changed the same way.

Locales

  • The changed strings are in en, es, pt-BR and zh: addToCollection.unresolved_count (and _one where it exists), reference.transform_none_resolved and reference.transform_partial_unresolved, and the new reference.transform_kept_more.
  • A new test renders them in each locale.

Checks

  • ESLint as CI runs it exits 0.
  • npm test passes: 266 tests, 4 of them new.
    • getKeptReferencesLabel, and its cap at five in all four locales;
    • both Transform alerts name the kept references with slashes intact, in all four locales;
    • the summary line in all four locales.
  • A production webpack build compiles.
  • Not checked in the app: the local stack is down. The border and wrapping were checked in a browser on a static page with the same CSS: before, no border and the URL overflowed; after, the border draws and the URL wraps at 340px.

🤖 Generated with Claude Code

…order and wrap at phone width; Transform names the kept references; Add References shows without a selection

@snyaggarwal snyaggarwal left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (Expansion Health epic, reviewed with OpenConceptLab/oclapi2#1073 and #113–#115): approve with one should-fix

1. Should-fix: "Add references" now shows to everyone, signed in or not.

  • Where: src/components/repos/RepoHome.jsx L627, the new fixedLeftControls branch.
  • Before: the button sat in extraBulkActions, which ResultsToolbar renders only when numSelected > 0.
  • Now: it's a left control, always rendered on a collection's References tab, with no access check.
  • Failure: an anonymous visitor, or a signed-in user who can't edit the collection, sees a primary "Add references" button on any public collection. Submitting the dialog then fails with a 403.
  • The other reference actions in Search.jsx (referenceActionsControl, bulkRemoveFromCollectionAction) are gated on isLoggedIn().
  • Fix: add currentUserHasAccess() (already imported in RepoHome) to the condition: isCollection && !isVersion && tab === 'references' && currentUserHasAccess().

Checked, no issue

  • ReferenceResultsTable:
    • the Box carries the border and radius, so it draws;
    • tableLayout: fixed with overflowWrap: anywhere lets the API's long version URLs wrap;
    • the last-row divider is dropped;
    • LABEL_COLUMN_WIDTH (30% / 40%) applies to the header cell, which is what the fixed layout reads.
      All three tables use it.
  • Transform, none resolved:
    • the rollback runs before the new branch, and a failed rollback still returns early with its own warning;
    • the warning path closes the dialog and clears the selection, and nothing changed, so not refetching is right.
  • getKeptReferencesLabel:
    • it matches proposedExpression against groups.unresolved[].expression;
    • getTransformOutcome already matches the added items on the same field, so the two agree;
    • UNESCAPED is used only for these API strings, which React escapes.
  • Locales:
    • unresolved_count, its _one forms and both transform keys are updated in all four locales;
    • en has no stale _one form, as the new test checks.
  • OpenConceptLab/oclapi2#1073: its new message has two URLs and is the longest the table shows. The wrapping here is what keeps it readable at phone width.
  • CI is green.

Nits

  1. The kept list is unbounded. Transforming a few hundred references that all resolve to nothing puts every expression into one alert. Consider listing the first ~5 and then "and N more".
  2. The Add references button and the expansion dropdown are now mutually exclusive in a nested ternary. That's fine today, since the dropdown only shows on Concepts and Mappings, but a short comment on the ternary would read more easily.

The wording ("N saved but added nothing", and the transform alerts) is Jon's call, as the description says.

@snyaggarwal

Copy link
Copy Markdown
Contributor Author

Thanks. From the independent review:

  1. Add references shows to everyone: fixed in 319a06d. The fixedLeftControls condition is now isCollection && !isVersion && tab === 'references' && currentUserHasAccess().
  • Nit 1, the unbounded kept list: fixed in 36b2464. getKeptReferencesLabel lists the first five kept references, then "and N more" (reference.transform_kept_more, in all four locales). A new test covers the cap in each locale.
  • Nit 2, a comment on the ternary: not changed.

The description is updated. Lint is clean and npm test passes (266).

@paynejd paynejd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review lead (Claude, for Jon), round 1

COMMENT: every earlier point is met and CI is green. The wording of the summary line and the two Transform alerts waits on Jon's call. Two small nits below.

Earlier points (Sunny's 13:18Z review and 14:07Z reply)

  1. Should-fix, "Add references" shown to everyone: met. src/components/repos/RepoHome.jsx L627 now reads isCollection && !isVersion && tab === 'references' && currentUserHasAccess() (319a06d).
  2. Nit 1, unbounded kept list: met. getKeptReferencesLabel in src/components/collections/referenceTransformUtils.js lists five, then reference.transform_kept_more ("and N more"); the new test covers all four locales (36b2464).
  3. Nit 2, comment on the nested ternary: not changed, accepted. It is still readable, and the comment above the branch says why it sits on the left.

All three are met or accepted.

New findings (small, neither blocks)

  1. src/components/search/Search.jsx L701: getKeptReferencesLabel matches unresolved expressions against the items of every request group together. If one include and one exclude group both produce the same non-versioned expression and only one is reported empty, the alert can name an original that the Transform did remove. That needs two selected references that differ only in the release they name, one included and one excluded, so it is unlikely. If it is easy, match each group's unresolved results to that group's items before joining.
  2. src/components/common/ReferenceResultsTable.jsx L8, LABEL_COLUMN_WIDTH: at 390px the 30% column breaks the header "Reference" mid-word ("Referen / ce"), because overflowWrap: anywhere applies to header cells too. Optionally set '& th': { overflowWrap: 'normal' }, or use 34%.

Checked, no issue

  • The border and radius sit on the wrapping Box; tableLayout: fixed and overflowWrap: anywhere wrap the long version URLs from oclapi2#1073; the divider under the last line is dropped. All three tables use ReferenceResultsTable.
  • Transform, none resolved: the rollback runs first; the warning path closes the dialog and clears the selection; a failed rollback still returns early with its own warning.
  • Locales: unresolved_count (with the _one forms in es and pt-BR), transform_none_resolved, transform_partial_unresolved and the new transform_kept_more are in en, es, pt-BR and zh.
  • UNESCAPED is used only for the API's own strings, which React escapes.
  • Seen in a mocked build at this head, with a one-line note: the kept list ends with a path's own slash, then a comma or a full stop ("…/A13/, …/A14/."). That is part of the wording call.

Wording
The summary line "N saved but added nothing" and both Transform alerts wait on Jon's call. They are not blockers.

CI: Lint and test and security/snyk both pass (266 tests).

…wn items, and a results table's header doesn't break mid-word
@snyaggarwal

Copy link
Copy Markdown
Contributor Author

Thanks. Replying to round 1. Both small findings are in 7084717.

  1. The kept list across groups: onTransformReferences now matches each group's unresolved results to that group's own items before joining them, so an include and an exclude proposing one expression can't name an original the Transform removed.
  2. The "Reference" header at 390px: header cells now use overflowWrap: 'normal', so the header doesn't break mid-word. Body cells keep anywhere, so long version URLs still wrap.

Lint and all 266 tests pass. The API message in OpenConceptLab/oclapi2#1073 now also says to rebuild the expansion after the new release; this PR shows the API's text as it comes, so nothing changes here.

@paynejd

paynejd commented Nov 26, 2026

Copy link
Copy Markdown
Member

Review lead (Claude, for Jon), round 2, head 7084717.

Both round-1 nits are fixed in 7084717:

  1. The kept list now matches each group's unresolved results to that group's own items (src/components/search/Search.jsx ~L700), so an include and an exclude proposing one expression can't name an original the Transform removed.
  2. Header cells use overflowWrap: 'normal' (src/components/common/ReferenceResultsTable.jsx), so "Reference" doesn't break mid-word; body cells still wrap long version URLs.

Lint and test (266) pass. The PR stays on hold for Jon's call on the expansions design, which includes the summary line and the two Transform alerts. Nothing else is open.

… place and access check with main's lock, and a refused transform shows its notice first
@snyaggarwal

Copy link
Copy Markdown
Contributor Author

@paynejd a reminder: this PR is ready in code (CI green, all review points met) and is waiting only on your decisions:

  1. Reference outcomes: keep the per-reference results as they are, or move to short labels per reference with counts first (the redesign proposed on ocl_online#549).
  2. Wording: the summary line "N saved but added nothing" and the two Transform alerts (none transformed; some kept, listing the kept references).

It merges once you decide. Ticket: OpenConceptLab/ocl_issues#3074.

…s first, then a chip per outcome with its definition, the references that need attention listed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@paynejd

paynejd commented Nov 29, 2026

Copy link
Copy Markdown
Member

Review lead (Claude, for Jon), round 3, head 4e0d816.

Verdict: one build defect and two small gaps left. The approach matches the settled answers on OpenConceptLab/ocl_online#549.

Should-fix: two files differ only in the case of their first letter. src/components/common/ReferenceOutcomes.jsx and src/components/common/referenceOutcomes.js sit side by side, and webpack resolves extensions: ['.js', '.jsx'] in that order. On a case-insensitive file system (macOS, Windows), import ReferenceOutcomes from './ReferenceOutcomes' picks up referenceOutcomes.js, so both result dialogs fail to render (React error #130), and webpack warns about the clash. CI builds on Linux, so it passes there. Renaming one of them, for example referenceOutcomeUtils.js, fixes it.

Met

  • Counts come first ("15 references: 13 saved, 2 not saved"; "5 transformed, 2 unchanged"), then one chip per class with its definition, with the classes that need attention first.
  • No "saved but added nothing" sentence, and no Transform alert listing paths.
  • Add References reads the reason codes from OpenConceptLab/ocl_issues#3074 | A reference to a concept added after the release says why it resolved to nothing and how to fix it oclapi2#1073, so that PR should merge first.
  • Fifteen labels match the rules page as they stand: Included, Already in collection, Filtered by parameters, Not in release, Concept version not found, Unsupported filter, Repository not found, Value set not expanded, Not found, Invalid reference, Save failed, Transformed, Already unversioned, Can't transform, Change incomplete.

Gaps

  1. An exclusion shows as "Included". Add References can add exclusions (includeExclude), but getAddOutcomeKey only looks at added and resolved, so a saved exclusion gets "Included", defined as "now in the collection". Pass the dialog's mode through so it gets the page's "Excluded": saved as an exclusion, whatever it matches is left out; it can match nothing and still be right.
  2. "Added nothing" isn't one of the page's labels. For a reason code TBv3 doesn't know, use the page's family label "Saved, no members", and keep the API's message in the details as you do now.

Nits
3. A few definitions differ from the page's in meaning: "Included" says "now in the collection", where the page says its concepts or mappings are in the expansion. The page's definitions can be used as they stand.
4. On main, not this PR: the Transform confirmation still says "remove the old pinned references". OCL's wording avoids "pin"; "the old versioned references" would do.

Classes the API can't tell apart yet ("Not evaluated", "In a newer release", "Conflicting reference", "Name conflict") can wait.

CI: Lint and test pass.

…le name, an added exclusion reads Excluded, an unknown reason reads Saved, no members, definitions speak of the expansion, and Transform speaks of versioned references

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@snyaggarwal
snyaggarwal merged commit 5812514 into main Nov 29, 2026
2 checks passed
@snyaggarwal
snyaggarwal deleted the ocl_issues-3074-display-fixes branch November 29, 2026 08:54
@snyaggarwal
snyaggarwal restored the ocl_issues-3074-display-fixes branch November 29, 2026 14:41
@snyaggarwal
snyaggarwal deleted the ocl_issues-3074-display-fixes branch November 29, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants