Repository navigation
OpenConceptLab/ocl_issues#3074 | Reference result tables draw their border and wrap at phone width; Transform names the kept references - #116
Conversation
…order and wrap at phone width; Transform names the kept references; Add References shows without a selection
snyaggarwal
left a comment
There was a problem hiding this comment.
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.jsxL627, the newfixedLeftControlsbranch. - Before: the button sat in
extraBulkActions, whichResultsToolbarrenders only whennumSelected > 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 onisLoggedIn(). - 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: fixedwithoverflowWrap: anywherelets 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
proposedExpressionagainstgroups.unresolved[].expression; getTransformOutcomealready matches the added items on the same field, so the two agree;UNESCAPEDis used only for these API strings, which React escapes.
- it matches
- Locales:
unresolved_count, its_oneforms and both transform keys are updated in all four locales;- en has no stale
_oneform, 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
- 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".
- 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.
…ho can edit the collection
… kept references, then how many more
|
Thanks. From the independent review:
The description is updated. Lint is clean and |
paynejd
left a comment
There was a problem hiding this comment.
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)
- Should-fix, "Add references" shown to everyone: met.
src/components/repos/RepoHome.jsxL627 now readsisCollection && !isVersion && tab === 'references' && currentUserHasAccess()(319a06d). - Nit 1, unbounded kept list: met.
getKeptReferencesLabelinsrc/components/collections/referenceTransformUtils.jslists five, thenreference.transform_kept_more("and N more"); the new test covers all four locales (36b2464). - 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)
src/components/search/Search.jsxL701:getKeptReferencesLabelmatches 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.src/components/common/ReferenceResultsTable.jsxL8,LABEL_COLUMN_WIDTH: at 390px the 30% column breaks the header "Reference" mid-word ("Referen / ce"), becauseoverflowWrap: anywhereapplies 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: fixedandoverflowWrap: anywherewrap the long version URLs from oclapi2#1073; the divider under the last line is dropped. All three tables useReferenceResultsTable. - 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_oneforms in es and pt-BR),transform_none_resolved,transform_partial_unresolvedand the newtransform_kept_moreare in en, es, pt-BR and zh. UNESCAPEDis 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
|
Thanks. Replying to round 1. Both small findings are in 7084717.
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. |
|
Review lead (Claude, for Jon), round 2, head 7084717. Both round-1 nits are fixed in 7084717:
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
|
@paynejd a reminder: this PR is ready in code (CI green, all review points met) and is waiting only on your decisions:
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>
|
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. Met
Gaps
Nits 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>
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.
2. The warning border doesn't draw.
<table>with collapsed borders andoverflow: hiddendoesn't draw its own border. The same is true of the failed table's red border.ReferenceResultsTableframes the table in a box that carries the border and the rounded corners.3. A reference the parameters exclude was summarised as "resolved to nothing".
4. Transform when nothing resolved.
Older points from the ticket
Wording for Jon
Locales
addToCollection.unresolved_count(and_onewhere it exists),reference.transform_none_resolvedandreference.transform_partial_unresolved, and the newreference.transform_kept_more.Checks
npm testpasses: 266 tests, 4 of them new.getKeptReferencesLabel, and its cap at five in all four locales;🤖 Generated with Claude Code