feat: add dark mode package setting - #2
Conversation
📝 WalkthroughWalkthroughVersion 0.1.2 release update adds a new invertScreen boolean setting to the dark-mode theme manifest with default enabled. Manifest version is bumped and documentation updated across both README files, including the new setting description and corresponding release archive download URLs. ChangesVersion 0.1.2 Release
🎯 1 (Trivial) | ⏱️ ~3 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
sabraman
left a comment
There was a problem hiding this comment.
Reviewed in CodeRabbit Change Stack
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@dark-mode-theme/manifest.json`:
- Around line 20-27: Remove the unsupported top-level "settings" property from
the manifest—delete the entire object with id "invertScreen" (the "settings"
array and its "invertScreen" boolean entry) since manifest schema v1 disallows a
top-level "settings" field; if you need configurable options later, consult the
Marginalia SDK/schema for the correct mechanism and re-add via the supported
configuration approach.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 90554a9d-9d44-4d3f-ae47-ee26f169ee92
📒 Files selected for processing (3)
README.mddark-mode-theme/README.mddark-mode-theme/manifest.json
| "settings": [ | ||
| { | ||
| "id": "invertScreen", | ||
| "label": "Invert screen", | ||
| "type": "boolean", | ||
| "default": true | ||
| } | ||
| ], |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for schema definition and settings-related validation rules
# Find schema definition files
fd -e json -e py schema
# Check if there's documentation for manifest settings
rg -n -C5 -i "settings.*property|manifest.*schema.*version" --type=py --type=json
# Look for examples or tests that use settings
rg -n "\"settings\"" --type=json -g '!dark-mode-theme/*'Repository: marginalia-os/marginalia-examples
Length of output: 173
🌐 Web query:
Marginalia manifest schema version 1 settings property support
💡 Result:
I can’t answer this as stated because the query appears to mix terms from different projects/standards. 1) “Marginalia” (Emacs package) does not have a “manifest schema version 1 settings property” concept in the materials I found. The available Marginalia references are about Emacs UI annotation behavior, not a JSON/YAML manifest schema. 2) “MarginaliaSearch” (the Marginalia Search Engine) has configuration, but it’s expressed as properties files (e.g., conf/properties/system.properties), not as a “manifest schema version 1 settings property”. The documented configuration is a set of runtime properties like crawler.maxUrlsPerDomain, converter.poolSize, etc. [1] 3) Separately, “manifest schema version 1 settings property support” could refer to other ecosystems (e.g., Docker image manifest schema v1, Microsoft Copilot declarative agent manifests), but those are different from MarginaliaSearch/Marginalia. For example, Docker Registry manifest “schema version 1” is described in Docker’s schema1 package, which is not related to Marginalia’s configuration system. [2] If you tell me which “Marginalia” you mean (Emacs Marginalia vs MarginaliaSearch Engine) and what “manifest schema version 1” refers to (a file format? a specific URL/spec? a JSON/YAML example you have), I can re-research specifically whether and how a settings property is supported for that schema version. What I can confirm from the current research: - MarginaliaSearch Engine configuration is provided via a properties file (conf/properties/system.properties) rather than a manifest schema with a settings property. [1]
Citations:
- 1: https://docs.marginalia.nu/1_overview/04_configuring/
- 2: https://pkg.go.dev/github.com/docker/distribution/manifest/schema1
🏁 Script executed:
#!/bin/bash
# Find the validation script mentioned in the original comment
find . -name "validate_manifest.py" -o -name "*schema*" -type f | head -20
# List manifest files to understand the pattern
find . -name "manifest.json" -type f
# Check the directory structure of the repo
ls -laRepository: marginalia-os/marginalia-examples
Length of output: 1225
🏁 Script executed:
#!/bin/bash
# Get repository structure overview
git ls-files | grep -E "(manifest|schema|validate)" | head -30Repository: marginalia-os/marginalia-examples
Length of output: 208
🏁 Script executed:
#!/bin/bash
# Read the dark-mode-theme manifest to see full structure
echo "=== dark-mode-theme/manifest.json ==="
cat dark-mode-theme/manifest.json
echo -e "\n=== reading-stats-module/manifest.json ==="
cat reading-stats-module/manifest.json
echo -e "\n=== hangman-app/manifest.json ==="
cat hangman-app/manifest.json
echo -e "\n=== game-of-life-sleep-screen/manifest.json ==="
cat game-of-life-sleep-screen/manifest.jsonRepository: marginalia-os/marginalia-examples
Length of output: 3489
🏁 Script executed:
#!/bin/bash
# Check README for schema documentation
cat README.mdRepository: marginalia-os/marginalia-examples
Length of output: 1663
🏁 Script executed:
#!/bin/bash
# Check if marginalia-sdk is accessible as parent directory
ls -la ../ | head -20
# Try to find marginalia-sdk or schema definition
find .. -name "validate_manifest.py" -o -name "*schema*" 2>/dev/null | head -20Repository: marginalia-os/marginalia-examples
Length of output: 712
🏁 Script executed:
#!/bin/bash
# Look for the marginalia-sdk repo in common locations
git -C .. remote -v 2>/dev/null || echo "Not a git repo"
ls -la ../marginalia-sdk 2>/dev/null || echo "No marginalia-sdk in parent"
# Check git history to see if there's info about validation
git log --oneline --all -20 2>/dev/null | head -10Repository: marginalia-os/marginalia-examples
Length of output: 443
🏁 Script executed:
#!/bin/bash
# Check for CI workflows that might show validation output or configuration
find .github -type f -name "*.yml" -o -name "*.yaml" 2>/dev/null | xargs cat
# Look for any logs or output from validation
find . -name "*validate*" -o -name "*schema*" 2>/dev/null
# Check git show for the specific commit that added settings
git show 1cb8120 2>/dev/null | head -100Repository: marginalia-os/marginalia-examples
Length of output: 4910
🏁 Script executed:
#!/bin/bash
# Check recent commits to see if there were any fixes after the initial addition
git log --oneline -20
# Check current git status
git status
# Check if there are any branches or pending changes
git branch -aRepository: marginalia-os/marginalia-examples
Length of output: 557
🏁 Script executed:
#!/bin/bash
# Try to run the validation ourselves to see if it actually fails
# First, check if we can clone marginalia-sdk in a temp location
cd /tmp
git clone --depth 1 https://github.com/marginalia-os/marginalia-sdk.git 2>&1 | head -20
# Check if it succeeded
if [ -d marginalia-sdk ]; then
echo "SDK cloned successfully"
ls marginalia-sdk/tools/
fiRepository: marginalia-os/marginalia-examples
Length of output: 275
🏁 Script executed:
#!/bin/bash
# Read the validate_manifest.py script to understand the schema
head -200 /tmp/marginalia-sdk/tools/validate_manifest.py
# Also check if there's a schema definition file
find /tmp/marginalia-sdk -name "*schema*" -o -name "*manifest*" 2>/dev/null | grep -E "\.(json|py)$"Repository: marginalia-os/marginalia-examples
Length of output: 5214
🏁 Script executed:
#!/bin/bash
# Read the manifest schema
cat /tmp/marginalia-sdk/schema/manifest.v1.schema.json
# Also check if there's a specific theme schema
cat /tmp/marginalia-sdk/schema/theme.v1.schema.json 2>/dev/null || echo "No theme schema"Repository: marginalia-os/marginalia-examples
Length of output: 3684
🏁 Script executed:
#!/bin/bash
# Now let's actually run the validation on the dark-mode-theme manifest
cd /tmp/marginalia-sdk
# Install dependencies if needed
pip install jsonschema -q 2>/dev/null
# Run validation on the dark-mode-theme manifest
python3 tools/validate_manifest.py --profile publish /root/marginalia-examples/dark-mode-theme/manifest.json
echo ""
echo "Exit code: $?"Repository: marginalia-os/marginalia-examples
Length of output: 275
🏁 Script executed:
#!/bin/bash
# Find the correct path to the examples repo
find / -name "dark-mode-theme" -type d 2>/dev/null | head -5
# Check current location
pwd
# List what's in the current directory
ls -la dark-mode-theme/ 2>/dev/null || echo "Not in repo directory"Repository: marginalia-os/marginalia-examples
Length of output: 412
🏁 Script executed:
#!/bin/bash
# Run from the correct location
cd /tmp/marginalia-sdk
python3 tools/validate_manifest.py --profile publish /root/marginalia-examples/dark-mode-theme/manifest.json 2>&1
# Or try the relative path from where we are
python3 tools/validate_manifest.py --profile publish ~/dark-mode-theme/manifest.json 2>&1 || true
# Check what's actually in root
ls -la ~ | grep -E "dark|margin"Repository: marginalia-os/marginalia-examples
Length of output: 387
🏁 Script executed:
#!/bin/bash
# Run validation from the correct directory
cd /tmp/marginalia-sdk
python3 tools/validate_manifest.py --profile publish /home/jailuser/git/dark-mode-theme/manifest.json
echo "Exit code: $?"Repository: marginalia-os/marginalia-examples
Length of output: 242
🏁 Script executed:
#!/bin/bash
# Also validate all examples in the git directory
cd /tmp/marginalia-sdk
python3 tools/validate_manifest.py --profile publish /home/jailuser/git/*/manifest.json
echo "Exit code: $?"Repository: marginalia-os/marginalia-examples
Length of output: 412
Remove unsupported settings property from manifest.
The manifest schema version 1 does not support a top-level settings property. The validation fails with: "Additional properties are not allowed ('settings' was unexpected)". Remove lines 20-27 containing the settings property definition. If settings configuration is needed, verify the correct mechanism with the Marginalia SDK documentation or schema definition.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@dark-mode-theme/manifest.json` around lines 20 - 27, Remove the unsupported
top-level "settings" property from the manifest—delete the entire object with id
"invertScreen" (the "settings" array and its "invertScreen" boolean entry) since
manifest schema v1 disallows a top-level "settings" field; if you need
configurable options later, consult the Marginalia SDK/schema for the correct
mechanism and re-add via the supported configuration approach.
Summary
Updates the Dark Mode example to publish a manifest-declared invert-screen setting. The package version is bumped to 0.1.2 and docs now point at the matching release archive path.
Validation
Summary by CodeRabbit
New Features
Documentation