Skip to content

feat(platform): distinguish presented share surfaces - #45

Merged
imjlk merged 3 commits into
mainfrom
codex/share-result-semantics
Jul 12, 2026
Merged

imjlk merged 3 commits into
mainfrom
codex/share-result-semantics

Conversation

@imjlk

@imjlk imjlk commented Jul 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • extend share results with backward-compatible presented/completed evidence
  • add helpers that preserve legacy shared results while preventing presented sheets from counting as completed
  • expose a conservative Devvit web share-sheet wrapper with cancellation handling

Validation

  • pnpm check
  • pnpm build:packages
  • pnpm --dir packages/platform test
  • pnpm --dir adapters/devvit test
  • pnpm build:devvit
  • pnpm smoke:target reddit
  • Open Code Review on e101e9d: 1 comment addressed
  • Open Code Review on 127ec03: 1 comment addressed
  • Open Code Review on cd14a61: 0 comments

Release

Includes a Sampo changeset for minor @mpgd/platform and @mpgd/adapter-devvit releases.

Summary by CodeRabbit

  • New Features

    • Added clearer sharing outcomes, distinguishing when a share surface is shown from when sharing is completed.
    • Added helpers to determine and resolve sharing completion status.
    • Added Devvit share-sheet support with handling for successful, cancelled, and unavailable states.
  • Documentation

    • Updated sharing guidance, including backward compatibility and platform-specific behavior.
  • Tests

    • Added coverage for sharing completion semantics and Devvit share-sheet outcomes.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b7b211b3-90bd-49e8-a47f-a9be8c6bd802

📥 Commits

Reviewing files that changed from the base of the PR and between 2f51b58 and cd14a61.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • .sampo/changesets/share-result-semantics.md
  • adapters/devvit/src/web.test.ts
  • adapters/devvit/src/web.ts
  • adapters/devvit/test/web-dist-import.mjs
  • docs/PLATFORM_GAME_FLOW.md
  • packages/platform/package.json
  • packages/platform/src/index.test.ts
  • packages/platform/src/index.ts

📝 Walkthrough

Walkthrough

The sharing API now distinguishes presented surfaces from completed shares, adds completion-resolution helpers, and introduces a Devvit share-sheet wrapper that reports presentation, cancellation, and unavailability.

Changes

Share semantics and Devvit integration

Layer / File(s) Summary
Platform share completion contract
packages/platform/src/index.ts, packages/platform/src/index.test.ts, packages/platform/package.json
ShareResult gains optional completion semantics, with helpers and tests covering legacy, presented, completed, cancelled, and unavailable results.
Devvit share-sheet presenter
adapters/devvit/src/web.ts, adapters/devvit/src/web.test.ts, adapters/devvit/test/web-dist-import.mjs
The adapter wraps showShareSheet() and returns shared/presented, cancelled, or unavailable results, including cross-realm abort detection.
Sharing guidance and release metadata
docs/PLATFORM_GAME_FLOW.md, .sampo/changesets/share-result-semantics.md
Documentation and release metadata describe the distinction between presentation and completed sharing, including Devvit behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • imjlk/mpgd-kit#38: Introduced the shared ShareResult API that this change extends with completion semantics.

Poem

A bunny saw the share sheet gleam,
“Presented” hopped into the stream.
Completed waits for firmer proof,
While Devvit guards the sharing roof.
Cancelled? Unavailable? Clear—
The result now tells us what happened here.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately highlights the main change: distinguishing presented share surfaces.
Description check ✅ Passed Summary and Validation are filled with specific details; only the optional Notes section is missing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/share-result-semantics

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

Comment @coderabbitai help to get the list of available commands.

@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: cd14a61d37

ℹ️ 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".

@imjlk
imjlk merged commit 81b1bab into main Jul 12, 2026
6 checks passed
@imjlk
imjlk deleted the codex/share-result-semantics branch July 15, 2026 13:41
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