Skip to content

feat(samples): Facelift for unity-of-bugs - #2958

Merged
bitsandfoxes merged 26 commits into
mainfrom
spire/unity-of-bugs-facelift
Nov 25, 2026
Merged

bitsandfoxes merged 26 commits into
mainfrom
spire/unity-of-bugs-facelift

Conversation

@bitsandfoxes

@bitsandfoxes bitsandfoxes commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Unity of Bugs spreads its samples over six scenes with big buttons. The feedback widget's button covers "Close Game". On a phone, the sample is awkward to use, and it looks rough in screenshots and session replays.

How

The sample opens on one scene, BugFarm, which shows a catalogue of SDK samples in Sentry's colours.

  • Categories: Errors, Crashes, Platform, Hangs, Context, Tracing, Logs & Metrics, Feedback, Scenes and Third party.
  • Layout:
    • In landscape, the categories are a column on the left. In portrait, they are a row of tabs that scrolls sideways.
    • Each category's page is built once, so a tapped tab or sidebar entry stays where it is and the list doesn't flash.
    • Scrolling bounces softly at the ends, a swipe isn't taken for a tap, and phones run at 60 fps.
  • Each sample is a compact row with its name, a line on what shows up in Sentry, and a short Run button.
  • Greyed out are samples that can't run on the current platform or scripting backend, or that need a missing package. Each one shows the reason.
  • Errors: a "Run on" choice runs them on the main thread, in a Task, an awaited Task, a coroutine or a Thread. A WebGL player has no threads, so there the Task, await and Thread choices are greyed out with the reason, and the samples run on the main thread.
  • Status line: at the bottom, it shows the last event ID, and at startup whether the last run crashed. It stops short of the bottom-right corner, where the feedback widget sits.
  • Header: Close Game is a small ✕ in the top-left. A 3D Sentry logo turns in the top-right, so screenshots and session replays always show motion.
  • Scenes: the scene-loading samples load a small ExtraScene, so the scene manager integration still gets exercised. BugFarm and ExtraScene are the sample's only scenes.
The Errors page in portrait, with the "Run on" choice, the ✕ in the top-left and the turning Sentry logo in the top-right The Feedback page in portrait: the tab row stays scrolled to Feedback after the tap The Feedback page in landscape, with the categories as a sidebar

The sample's scripts are split by what a reader is looking for, and Scripts/README.md explains the layout:

  • The configuration sits at the top of Scripts/: SentryOptionConfiguration.cs, SampleOptionConfiguration.cs and SentryCliConfiguration.cs.
  • Scripts/Samples/ shows the SDK usage: one file per tab (ErrorSamples.cs, CrashSamples.cs, …) and the "Run on" helper. The C, C++, Objective-C, Kotlin and JavaScript plugins the native samples call, with their C# bridge, are in Samples/NativePlugins/.
  • Scripts/Scaffolding/ holds the app around the samples: the menu, its UI, the runner and status line, the list of tabs, the extra scene, the logo and the input-module helper.

How it's built:

  • The menu: SampleCatalogue lists the categories in menu order.
  • Sample IDs: each sample has a stable ID, such as crashes/native-c. The menu names its rows by it, and the log prints it when a sample runs.
  • Delayed samples (a tween callback, a forgotten UniTask) wait for their exception before the status line reports, so it shows the event's ID.
  • The header's logo is drawn with its own material, SentryLogo.mat, in the menu's accent colour. The material names its shader, so player builds include the shader without relying on the project's always-included shaders. If the material can't load, the logo keeps its default look and a warning is logged.
  • The Objective-C exception sample raises its NSException with raise. Unity's Xcode project builds with Objective-C exceptions off, and @throw needs them on.
  • The tests that load scenes use BugFarm and ExtraScene. The package snapshot and the plugin platform test name the scripts' paths.

Caveats

  • On iOS, the sample turns on IosWatchdogTerminationIntegrationEnabled, which is off by default in the SDK. The out-of-memory sample's result needs it. The sample's description and the code comment in SampleOptionConfiguration.cs say so. It is the sample's only change from the SDK's default options.
  • Both sample projects build Android for ARM64 only.
  • The header's logo is a small FBX model with its material in the sample's Scripts/Scaffolding/Resources/, so a project that imports the sample builds both in.

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against c076ba1

@bitsandfoxes
bitsandfoxes marked this pull request as ready for review November 24, 2026 16:34

@cursor cursor 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.

Stale Bugbot comment from a previous run.

@bitsandfoxes
bitsandfoxes force-pushed the spire/unity-of-bugs-facelift branch from ce132d6 to c70c873 Compare November 25, 2026 10:49

@cursor cursor 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.

Stale Bugbot comment from a previous run.

The six sample scenes become one scene, BugFarm, whose menu is built from
code out of a catalogue of samples with stable IDs (errors/capture-message,
crashes/native-c, ...). The menu fits landscape and portrait, keeps clear of
the safe area and the feedback button, and greys out samples that can't run
in the current build or would crash the Editor. ExtraScene is the target of
the scene-loading samples, loaded single, additively or asynchronously.

A build runs a sample on its own when launched with `sample=<id>` (and an
optional `run_id=<id>`, set as the `sample.run_id` tag): it logs the
catalogue, runs the sample, flushes and quits. Without the argument the app
stays open.

Debug symbol upload reads its auth token from SENTRY_AUTH_TOKEN in the
environment the Editor or the build was started from, and is off without it.
Android builds target ARM64 only.
scripts/run-sample.ps1 builds and installs Unity of Bugs on an Android or
iOS device, emulator or simulator, runs catalogue samples through launch
arguments with a run ID, and finds what each sent in Sentry by that ID:
arrival, symbolication and context, with a Markdown report.

build-sample.ps1 takes -IosSdk Device|Simulator. The sample runs several
comma-separated IDs in one launch, and its scene samples finish once the
scene has loaded. docs/agent-guides/devices.md covers the workflow.
…ple.ps1

The project's event list ignores tag queries, so a run's events are found
through the issues the sample.run_id tag matches. -Build prints the
sentry-cli upload summary from the Gradle log or the Xcode build phase's
log. build-sample.ps1 reads script eval's return value from its result.
… iOS Simulator

SampleOptionConfiguration extends SentryOptionConfiguration with the
watchdog termination option the out-of-memory sample needs, and the
options asset points to it. run-sample.ps1 skips the out-of-memory sample
on a simulator, which has no iOS memory limit, and counts frames from the
simulator runtime's system libraries as system frames.
@bitsandfoxes
bitsandfoxes force-pushed the spire/unity-of-bugs-facelift branch from ae12a7b to b0f3fd7 Compare November 25, 2026 12:31

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b0f3fd7. Configure here.

@bitsandfoxes bitsandfoxes changed the title feat(samples): Turn Unity of Bugs into one sample catalogue feat(samples): Facelift for unity-of-bugs Nov 25, 2026

@JoshuaMoelans JoshuaMoelans 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.

🚀

@bitsandfoxes
bitsandfoxes merged commit 7293b69 into main Nov 25, 2026
134 of 136 checks passed
@bitsandfoxes
bitsandfoxes deleted the spire/unity-of-bugs-facelift branch November 25, 2026 14:28
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