Skip to content

Choose where the DOI leads on the DOI step - #1754

Merged
sickerine merged 4 commits into
devfrom
feat/doi-place-early
Dec 6, 2026
Merged

sickerine merged 4 commits into
devfrom
feat/doi-place-early

Conversation

@sickerine

Copy link
Copy Markdown
Collaborator

Part of #1746. Built from the agreed mock (mock/doi-place-early).

Both first-use walkers learned that the official page must show the DOI only at the address field, after signing and uploading.

DOI step. "Where the DOI leads" is now chosen right under the reserved DOI, before the byline.

  • The pick is kept on the report (reports/flow:chooseLanding) until the PDF's details are read, then becomes part of the details.
  • It can't change once the checks start. After that, it changes in the details or as a correction.
  • Next saves a pick still waiting to be saved.

Details and corrections. The section moves up to right after The work.

What to do, and why. Under the place picked:

  • The report's page: "There's nothing to add anywhere else."
  • A place past it: put the DOI on that page as text near the title, with the DOI to copy, why readers and Crossref need it there, and that Openscholar doesn't check the page.
  • No official page yet: the DOI step says the report's page can stay and the place can change later. Where the series doesn't allow the report's page, it says the address can wait for the details.

Settings. Once a series allows a place past the report's page, the admin is told what that asks of authors.

Checks

  • tsc, check:ui-rules, check:user-actions and check:convex-rules pass.

  • Vitest convex/reports and lib/reports pass, 325 tests. The new integration test covers:

    • a pick on the DOI step reaching the details when the PDF is read;
    • a later pick changing the details;
    • a pick refused once the checks start.

    It fails without the hand-over to the details.

  • The screens were walked as the mock (agreement and DOI step, the correction form) in Chromium against shared dev. The save from the page reaches shared dev only after this deploys; the walker wave after the merge runs it.

…at that asks of the author

Both first-use walkers learned only at the address field, after signing and uploading, that the official page must show the DOI. Where the DOI leads is now chosen under the reserved DOI, before the byline (kept on the report until its details are read, then theirs: reports/flow:chooseLanding), and comes right after The work in the details and corrections.

Under the place picked, a box says what to do and why: the report's page needs nothing; a place past it asks for the DOI on that page as text near the title, with the DOI to copy, why readers and Crossref need it there, and that Openscholar doesn't check the page. Without an official page yet, the step says the report's page can stay and the place can change later. The series' settings tell the admin what a place past the report's page asks of authors.

Part of #1746
@coderabbitai

coderabbitai Bot commented Dec 5, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e45af8be-8f41-496e-8119-282976d3eac1
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-05T23:45:40.822023Z 9905687 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9905687f69

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread components/reports/publish-flow.tsx Outdated
// as the report's until its details are read, then as theirs (convex/reports/flow.ts `chooseLanding`).
const tLead = useTranslations("publishReports.lead");
const chooseLanding = useMutation(api.reports.flow.chooseLanding);
const [landing, setLanding] = useState(report.metadata?.landing ?? report.landing);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Stop falling back to the initial landing once details exist

If an author picks an external landing on the DOI step, later switches to the report's page in Details, and runs the checks, checkedDetails removes metadata.landing because an absent landing represents the report's page (lib/reports/report.ts, landingPlaceOf). Returning to the DOI step through the supported back navigation then falls back to the stale external report.landing, displaying the wrong destination and instructions. Use the report-level fallback only when metadata does not yet exist; an undefined landing within existing metadata is already a meaningful selection.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 936cf42.

Comment thread convex/reports/flow.ts Outdated
if (landing.url.length > DETAIL_TEXT.link) throw createError("VALIDATION_ERROR", `Keep the official page's address to ${DETAIL_TEXT.link} characters.`);
const details = await detailsOf(ctx, report._id);
if (details.metadata) await ctx.db.patch("reportDetails", details._id, { metadata: { ...details.metadata, landing } });
await touch(ctx, report, { landing });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Invalidate completed checks when changing the landing

When a report ready for activation is reopened at the DOI step, goTo sets reopened: true and the completed run is already cleared, so this mutation accepts changes to its metadata. Unlike saveDetails, it leaves reopened set, allowing the author to use the step trail to call backToChecks and then activate with the previous results and approval. This also bypasses the URL and allowed-place validation performed only when checks start, so an incomplete official-page address can reach registration. Clear reopened when saving the changed landing so the updated details must pass through checks again.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 936cf42.

… its checks again

Codex review: a ready report reopened at the DOI step could change where its DOI leads and go back to its earlier checks with Back to checks, skipping the address checks; the pick now clears reopened, as saving any other detail does. And once the details are read, none there is the report's page: the DOI step no longer falls back to the pick kept on the report before them.
Cross-family review: a pick made in the last 400 ms before a reload or close was lost. It is sent as the page goes, as the details form sends its edits.
@sickerine
sickerine merged commit dfea43d into dev Dec 6, 2026
8 of 10 checks passed
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.

1 participant