Skip to content

OpenConceptLab/ocl_online#884 | A collection's expansions page shows the health result by itself, and says Default only for the default - #129

Open
paynejd wants to merge 3 commits into
OpenConceptLab/ocl_issues-3004-expansion-marks-switchfrom
ocl_online-884-expansions-page
Open

paynejd wants to merge 3 commits into
OpenConceptLab/ocl_issues-3004-expansion-marks-switchfrom
ocl_online-884-expansions-page

Conversation

@paynejd

@paynejd paynejd commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Closes OpenConceptLab/ocl_online#884

This goes onto #122's branch, because both change CollectionVersionsTab.jsx. It moves to main when #122 is in.

1. The open page shows the health result by itself. It used to say "Checking health" until the owner left the tab and came back.

  • While a version's health is being checked, the page reads that version's expansions again every 30 seconds, as it does while one is being built.
  • It stops when there's a result, when the tab is left, and after 20 reads (ten minutes) without one. Each expansion has its own count.
  • The open details window shows the result too.
  • With EXPANSION_MARKS_TOGGLE off, nothing asks for health.
  • A read sent after a change wins over one that was already under way, so a regular read can't bring back the old default.

2. The list says "Default" only for the version's own default expansion.

  • A version with expansions and no default says "Default: None". It named its first expansion.
  • While the marks are off, the list under a version also marked the newest expansion of an auto-expanding version as the default. It doesn't now.
  • Which one is the default follows the version. A default that was cleared or changed in the version's form, or elsewhere, doesn't stay marked in the list.
  • Set as default is offered as before.

Left as it is, on purpose: a version with no default still takes its counts, warning icon and release updates from its first expansion.

Nothing new is drawn.

How it was checked

To check on staging: make a version's expansion, or set another one as default, and leave the page open. "Checking health" turns into the result by itself, within about two minutes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN

paynejd and others added 2 commits December 4, 2026 04:48
…the health result by itself, and says Default only for the default

While a version's health is being checked, the open page reads its expansions again every 30 seconds, as for a build,
until there's a result, the page is left or ten minutes have passed. The open details window shows the result too. With
the marks off, nothing asks for health.

A version with expansions and no default says "Default: None". It named its first expansion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
…n, and each health check has its own ten minutes

A default that was cleared in the version's form stayed marked in the list, and one set in the list hid a later edit.
A version that is busy with an export and has no default says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Codex review, pass 1 (codex-cli 0.171.0, commit 081a9fe)

4 findings: P1 1, P2 3.

  • F1.1 (P1) ExpansionRowListWithoutMarks.jsx:148: With marks off, clearing the default can leave the old expansion labeled Default and hide Set as default for it.
  • F1.2 (P2) CollectionVersionsTab.jsx:538: A change to another version's pending status resets the ten-minute polling limit for every pending expansion.
  • F1.3 (P2) CollectionVersionsTab.jsx:535: Polling repeats the first page of expansions even when the default is on a later page.
  • F1.4 (P2) defaultExpansion.js:9: A background job can make a version with expansions and no default say Default: Auto-expand.
findings.json
{
  "reviewer": "codex-cli 0.171.0",
  "perspective": "defects",
  "mode": "full",
  "commit": "081a9fe41670176704627b9319e8b61d82094748",
  "verdict": "findings",
  "prior": [],
  "findings": [
    {
      "id": "F1.1",
      "severity": "P1",
      "tag": null,
      "file": "src/components/repos/ExpansionRowListWithoutMarks.jsx",
      "line": 148,
      "claim": "With marks off, clearing the default can leave the old expansion labeled Default and hide Set as default for it.",
      "scenario": "Open Versions + Expansions with marks off, let the expansion list load, then clear a named version's expansion in Edit. The refreshed version has a null expansion_url, so the version row says Default: None. Its cached expansion still has default: true because the marks-off refresh skips the cached list. The expansion row still says Default and its menu omits Set as default.",
      "action": "Derive the expansion row's badge and menu eligibility from the latest version's expansion_url, including with marks off.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F1.2",
      "severity": "P2",
      "tag": null,
      "file": "src/components/repos/CollectionVersionsTab.jsx",
      "line": 538,
      "claim": "A change to another version's pending status resets the ten-minute polling limit for every pending expansion.",
      "scenario": "Expansion A's check gets lost. At minute nine, a check for expansion B starts or finishes. The pending URL list changes, which gives A a fresh ten-minute timer even though its pending status has stayed the same.",
      "action": "Track the polling deadline per default expansion and preserve it when other expansions enter or leave the pending set.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F1.3",
      "severity": "P2",
      "tag": null,
      "file": "src/components/repos/CollectionVersionsTab.jsx",
      "line": 535,
      "claim": "Polling repeats the first page of expansions even when the default is on a later page.",
      "scenario": "A version has more than 25 expansions and its default is outside the first API page. The version summary contains a prior healthy result with is_current: false, so the row says Checking health. Every poll rereads the same first page and leaves that summary stale. The row still says Checking health after the server has finished the check and the timer has expired.",
      "action": "When the expansion list omits the default, poll its expansion_url or refresh the version summary used by the row.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F1.4",
      "severity": "P2",
      "tag": null,
      "file": "src/components/repos/defaultExpansion.js",
      "line": 9,
      "claim": "A background job can make a version with expansions and no default say Default: Auto-expand.",
      "scenario": "An autoexpand-enabled version has existing expansions and a cleared default. While an export is running, the API reports is_processing: true. The label implies an automatic default is coming even though the export does not assign one.",
      "action": "Return None when expansions are present and expansion_url is empty. Update the test that expects Auto-expand for that state.",
      "lines_delta": null,
      "confidence": "high"
    }
  ]
}

@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Answers to pass 1, in the second commit:

  • F1.1 (P1): fixed, and the class with it. Which expansion is the default is now worked out from the version, not stored with the list, so the label, the list and Set as default agree whichever is read again. A default set in the list no longer hides a later edit of the version either. Checked in a browser with the marks on and off: on OpenConceptLab/ocl_issues#3004 OpenConceptLab/ocl_issues#3009 | The expansion marks and the newer-release panel show only with EXPANSION_MARKS_TOGGLE #122's build the cleared default stayed, and now both say none.
  • F1.2 (P2): fixed. Each expansion has its own ten minutes, kept as a build's polling is.
  • F1.3 (P2): accepted. It needs a version with more than 25 expansions, and the most any version has is 11.
  • F1.4 (P2): fixed. "Auto-expand" shows only while the version has no expansions yet or one is being built, not while the version is busy with something else. The test was changed first and failed on the old code.

…the version, so its next read replaces it

HEAD's was kept over every later read. And a version that has expansions and no default says None while one of them is
rebuilt, also when it was made with autoexpand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qVmwkeg26E7AcP35TN
@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Codex review, pass 2 (codex-cli 0.171.0, commit d9b639e)

3 findings: P1 1, P2 2.

  • F2.1 (P1) CollectionVersionsTab.jsx:285: A local HEAD override can keep the wrong expansion marked as Default after the tab reads fresh HEAD data.
  • F2.2 (P2) defaultExpansion.js:9: Rebuilding an existing nondefault expansion can make a version with no default display Auto-expand.
  • F2.3 (P2) expansionHealth.js:43: The polling limit counts timer callbacks, so delayed callbacks can send requests past the ten-minute deadline.
findings.json
{
  "reviewer": "codex-cli 0.171.0",
  "perspective": "defects",
  "mode": "verify",
  "commit": "d9b639ed56785ea381a1bdebb17b39ddddf1ac78",
  "verdict": "findings",
  "prior": [
    {
      "id": "F1.1",
      "status": "unresolved"
    },
    {
      "id": "F1.2",
      "status": "resolved"
    },
    {
      "id": "F1.3",
      "status": "unresolved"
    },
    {
      "id": "F1.4",
      "status": "regressed"
    }
  ],
  "findings": [
    {
      "id": "F2.1",
      "severity": "P1",
      "tag": null,
      "file": "src/components/repos/CollectionVersionsTab.jsx",
      "line": 285,
      "claim": "A local HEAD override can keep the wrong expansion marked as Default after the tab reads fresh HEAD data.",
      "scenario": "Set HEAD's default to A in one tab, then set it to B in another. In the first tab, create a third expansion to trigger a refresh. The HEAD response names B, but the retained override still marks A as Default and offers Set as default on B.",
      "action": "Retire the HEAD override when a HEAD read started after the successful write returns.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F2.2",
      "severity": "P2",
      "tag": null,
      "file": "src/components/repos/defaultExpansion.js",
      "line": 9,
      "claim": "Rebuilding an existing nondefault expansion can make a version with no default display Auto-expand.",
      "scenario": "Clear the default on a version created with Auto-expand, then open the tab while an existing expansion is being rebuilt. The API returns a null expansion_url and is_processing true for the rebuild. The row says Default: Auto-expand even though the rebuild leaves the default unset.",
      "action": "Show None when the loaded list contains expansions and the version has no default. Keep the Auto-expand placeholder for initial creation.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F2.3",
      "severity": "P2",
      "tag": null,
      "file": "src/components/repos/expansionHealth.js",
      "line": 43,
      "claim": "The polling limit counts timer callbacks, so delayed callbacks can send requests past the ten-minute deadline.",
      "scenario": "Leave a tab open with a lost check still pending, then put the laptop to sleep after the first poll. On wake 30 minutes later, the timer can resume sending health requests even though the ten-minute window has elapsed.",
      "action": "Record a deadline when polling starts and check it before sending each request.",
      "lines_delta": null,
      "confidence": "high"
    }
  ]
}

@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Answers to pass 2, in the third commit:

  • F2.1 (P1): fixed by removing the separate copy. A default set in the list now goes into the version itself, so whatever the next read says replaces it, for HEAD as for the others. Checked in a browser, marks on and off: HEAD's default set here, changed elsewhere, then shown after the next refresh.
  • F2.2 (P2): fixed. "Auto-expand" shows only while the version has no expansions yet. The test was changed first and failed on the old code.
  • F2.3 (P2): accepted. The limit is on how often the page asks, at most 20 times, and it still holds after a laptop wakes up. Asking again then shows the result to the person who has just come back.

@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Simplification review (claude subagent, commit 8e7ba3e)

3 possible cuts.

  • S1 (shrink) CollectionVersionsTab.jsx:531: readHealthRef, plus the lookup by URL through find(checkingHealthVersions, {expansion_url: url}) on every tick, exists only so a long-lived interval can see current state. Each poll is already keyed by the version's expansion_url, so the ref could hold the current checkingHealthVersions array directly, and the poll callback could call fetchExpansions on the version found in it. The wrapper closure and the ref assignment during render collapse into one ref.
  • S2 (shrink) defaultExpansion.js:2: findDefaultExpansion repeats its guard: version?.expansion_url && expansions?.find(...) followed by || null. Find returns undefined, and the callers only compare the result to null or read .mnemonic from it.
  • S3 (dup-test) defaultExpansion.test.js:27: The test 'the default is named by its URL until the expansions have loaded' and the two Auto-expand cases in 'a version that will get its expansion says so' largely restate branch checks already covered by the first two tests. The undefined and [] variants of NONE repeat the same branch as the empty-list case.
findings.json
{
  "reviewer": "claude subagent",
  "perspective": "simplify",
  "mode": "full",
  "commit": "8e7ba3e381e416e0063eeb6848ac0903a31a6166",
  "verdict": "findings",
  "prior": [],
  "findings": [
    {
      "id": "S1",
      "severity": null,
      "tag": "shrink",
      "file": "src/components/repos/CollectionVersionsTab.jsx",
      "line": 531,
      "claim": "readHealthRef, plus the lookup by URL through find(checkingHealthVersions, {expansion_url: url}) on every tick, exists only so a long-lived interval can see current state. Each poll is already keyed by the version's expansion_url, so the ref could hold the current checkingHealthVersions array directly, and the poll callback could call fetchExpansions on the version found in it. The wrapper closure and the ref assignment during render collapse into one ref.",
      "scenario": null,
      "action": "Keep a single ref (for example checkingVersionsRef.current = checkingHealthVersions) and have the poll callback do the find and fetch inline, so the extra readHealthRef.current = url => {...} indirection goes.",
      "lines_delta": -3,
      "confidence": "low"
    },
    {
      "id": "S2",
      "severity": null,
      "tag": "shrink",
      "file": "src/components/repos/defaultExpansion.js",
      "line": 2,
      "claim": "findDefaultExpansion repeats its guard: `version?.expansion_url && expansions?.find(...)` followed by `|| null`. Find returns undefined, and the callers only compare the result to null or read .mnemonic from it.",
      "scenario": null,
      "action": "Return `expansions?.find(expansion => expansion.url === version?.expansion_url && version.expansion_url)`, or drop the `|| null` and compare with `== null`. The tests assert `null` via assert.equal, so they would need loosening or a kept `?? null`.",
      "lines_delta": -1,
      "confidence": "low"
    },
    {
      "id": "S3",
      "severity": null,
      "tag": "dup-test",
      "file": "src/components/repos/__tests__/defaultExpansion.test.js",
      "line": 27,
      "claim": "The test 'the default is named by its URL until the expansions have loaded' and the two Auto-expand cases in 'a version that will get its expansion says so' largely restate branch checks already covered by the first two tests. The `undefined` and `[]` variants of NONE repeat the same branch as the empty-list case.",
      "scenario": null,
      "action": "Merge the last three tests into one table-driven test, or drop the `label(NONE, undefined)` and `label(version, undefined)` repeats. The branches stay covered.",
      "lines_delta": -5,
      "confidence": "low"
    }
  ]
}

Answers:

  • S1: declined. A read needs the render's current fetchExpansions and loadingByVersion too, not only the list, so one ref to one function is the short form. With only the list in the ref, the interval would keep the first render's copies of the other two.
  • S2: declined. It saves no line, and the guard keeps a version without a default from matching an expansion without a URL.
  • S3: declined. "Not loaded yet" and "loaded, and empty" are two states of the page, and each test names one thing that the list says.

@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Codex review, pass 3 (codex-cli 0.171.0, commit 8e7ba3e)

2 findings: P2 2.

  • F3.1 (P2) CollectionVersionsTab.jsx:319: A failed duplicate refresh can discard the successful response that contains a newly created expansion.
  • F3.2 (P2) CollectionVersionsTab.jsx:559: An older versions response can restore the previous default after Set as default succeeds.
findings.json
{
  "reviewer": "codex-cli 0.171.0",
  "perspective": "defects",
  "mode": "verify",
  "commit": "8e7ba3e381e416e0063eeb6848ac0903a31a6166",
  "verdict": "findings",
  "prior": [
    {
      "id": "F1.1",
      "status": "resolved"
    },
    {
      "id": "F1.2",
      "status": "resolved"
    },
    {
      "id": "F1.3",
      "status": "unresolved"
    },
    {
      "id": "F1.4",
      "status": "resolved"
    },
    {
      "id": "F2.1",
      "status": "resolved"
    },
    {
      "id": "F2.2",
      "status": "resolved"
    },
    {
      "id": "F2.3",
      "status": "unresolved"
    }
  ],
  "findings": [
    {
      "id": "F3.1",
      "severity": "P2",
      "tag": null,
      "file": "src/components/repos/CollectionVersionsTab.jsx",
      "line": 319,
      "claim": "A failed duplicate refresh can discard the successful response that contains a newly created expansion.",
      "scenario": "With marks enabled, create a non-default expansion for a version whose expansion list is already loaded. Creation starts an expansions GET, and the versions refresh starts a second GET before the first finishes. If the second GET fails, the request counter discards the first GET's successful response. The new expansion stays missing until another refresh.",
      "action": "Coalesce expansion refreshes triggered by the same edit. Preserve request ordering across edits so a response captured before a write cannot replace post-write data.",
      "lines_delta": null,
      "confidence": "high"
    },
    {
      "id": "F3.2",
      "severity": "P2",
      "tag": null,
      "file": "src/components/repos/CollectionVersionsTab.jsx",
      "line": 559,
      "claim": "An older versions response can restore the previous default after Set as default succeeds.",
      "scenario": "Set expansion B as the default, then change the table's page size while the PUT is pending. If the page-size request reads the previous default A before the write commits and arrives after the post-write refresh, it replaces the version containing B. The tab marks A as Default until another version refresh.",
      "action": "Track versions request order and invalidate reads started before a successful default change.",
      "lines_delta": null,
      "confidence": "high"
    }
  ]
}

@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Answers to pass 3, the last one. No P0 or P1 is open, and nothing was committed after it.

  • F3.1 (P2): accepted. It needs a failed request while another one is under way. The list then stays as it was until its next refresh, as after any failed refresh today.
  • F3.2 (P2): accepted. It needs the page size changed in the moment a default is being saved, and the two answers to arrive in the wrong order. The default is saved all the same, and the next refresh shows it.
  • F1.3 and F2.3: accepted before, with the reasons given there.

@paynejd
paynejd requested a review from snyaggarwal December 4, 2026 10:15
@paynejd
paynejd marked this pull request as ready for review December 4, 2026 10:15

@snyaggarwal snyaggarwal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ready to merge once #122 is in. I'm posting this as a comment rather than an approval only because it's stacked on #122's branch. Merge order: OpenConceptLab/oclapi2#1115, then #122, then this PR moved to main, as the PR body says. If #122 is squash-merged, rebase this PR onto main (git rebase --onto main 0e080ebf2) before merging, so #122's original commits don't come along. I found nothing blocking in the code. CI is green.

It's behind EXPANSION_MARKS_TOGGLE where it needs to be.

  • The health polling is a mark and is gated: checkingHealthVersions is [] when showMarks is off, so no poll starts and nothing asks for health. The details window follows the list and only shows health through ExpansionHealthSection, which #122 already gates.
  • The "Default" label is a bug fix in both modes, not a mark, so it's right that it isn't gated. In ExpansionRowListWithoutMarks, expansion.default || expansion.auto becomes expansion.default. That now matches ExpansionRowList, which never read .auto. It means the marks-off view no longer matches 3.0.59 pixel for pixel for that one badge, as the PR body says.

It fits on #122 without conflicts. It's based on #122's current head (0e080ebf2), and #122 hasn't changed since.

  • versionOverrides is gone. Set as default now writes expansion_url into versions and headVersion, and expansionsByVersion is derived from loadedExpansions and the versions. The label, the list and the health all follow the latest version read. I checked that the derived value can't loop: displayVersions is memoized in useProcessingVersions, and the auto-expand effect returns prev when nothing changed.
  • Matching the health expansion by findDefaultExpansion (the version's expansion_url only) agrees with getVersionHealthStatus, which was already strict.
  • The leftover "first expansion" fallback in getDefaultExpansion (for counts, the warning icon and release updates) is left as it is on purpose, as the PR body says.

The Codex findings and simplification items are already answered on the PR. I'm not raising F1.3 (more than 25 expansions), F2.3 (a laptop waking up), F3.1 or F3.2 again.

This branch has not been deployed

No deployments
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