feat(config): upstream ContextMod check-shape compat + dashboard post lifecycle#35
Merged
Merged
Conversation
Addresses SampleOfNone feedback (2026-06-09) on the dashboard custom-post lifecycle. The "View recent actions" menu previously created a brand-new Observatory post on every click, left it sitting in the public feed, and set no splash cover. - Reuse: store the post id per sub (K.dashboardPostId) and reopen the existing post via getPostById; only create a new one when none exists or the stored post is gone. - Remove: immediately reddit.remove() the post after creation so the dashboard never sits in the public feed. Mods reach it via the stored permalink; non-mods hit the server-gated "Moderators only" screen. Best-effort (a remove failure still returns the mod a working link). - Splash: set a splash cover on the post. NB SubmitCustomPostSplashOptions is deprecated in @devvit 0.12.24 (migrate to an inline HTML splash entrypoint with the 0.13.x bump) but is the only splash API in-version. Tests: +4 cases (create-removes-and-stores, reuse-existing, recreate-when- gone, remove-failure-still-returns-link). Full suite 927 green; tsc + lint clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…dition/itemIs) SampleOfNone (2026-06-09) hit validation errors pasting a real ContextMod config: our MVP-trim Check schema rejected upstream-only fields (enable, description, kind, itemIs) and required `combinator`, which upstream calls `condition`. - Normalize upstream shape pre-validate (config.ts): map `condition` (AND/OR) to `combinator`, default a missing combinator to AND, and lift check-level `itemIs`/`authorIs` into our nested `filters`. Genuinely unsupported fields are still rejected with a clear error rather than silently dropped (a mod must know when a field is ignored). - Schema: `combinator` is now optional; `enable`, `description`, `kind` are accepted natively. - Honor the semantics, not just accept (runCheck.ts): a check with enable:false is skipped entirely; `kind` scopes a check to submissions or comments only. - Types: Check gains enable?/description?/kind?. Tests: +8 (upstream-shape parse + normalization, enable-skips, kind-targeting); re-pointed the "missing required field" test at `rules` since combinator is now optional. Full suite 935 green; tsc + lint clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adversarial-review follow-up. The post-create reddit.remove() is best-effort; on failure the post stays in the public feed but the mod (who cannot read server logs) was told 'Observatory dashboard ready' with no caveat. Now the toast says the post could not be hidden and to remove it manually. Also pins the reuse-path no-rewrite invariant in tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three pieces of senior-dev feedback from SampleOfNone (2026-06-09) on the Observatory dashboard and config compatibility.
Changes
fix(menu)): "View recent actions" now reuses the sub's existing Observatory post (stored id +getPostById) instead of creating a new one each click; immediately removes the post from the public feed after creation (mods reach it via the stored permalink, non-mods hit the server-gated "Moderators only" screen); sets a splash cover. On a remove failure the mod is told the post needs manual removal.feat(config)): real ContextMod check configs now validate. A pre-validate normalization mapsconditiontocombinator(default AND) and lifts check-levelitemIs/authorIsintofilters.enable,description,kindare accepted natively and honored:enable: falseskips the check;kindscopes it to submissions or comments. An unrecognizedconditionvalue is left for the validator to reject with a clear error rather than silently coerced to AND.Verification
/api/*data and action endpoint enforces moderator status server-side and fails closed.Notes
submitCustomPostsplash option; migrate to an inline HTML splash entrypoint with the 0.13.x framework bump.🤖 Generated with Claude Code