Skip to content

orcpub#265

Open
sandmanemp wants to merge 999 commits into
larrychristensen:masterfrom
Orcpub:develop
Open

orcpub#265
sandmanemp wants to merge 999 commits into
larrychristensen:masterfrom
Orcpub:develop

Conversation

@sandmanemp
Copy link
Copy Markdown

https://github.com/Orcpub/orcpub/tree/develop/.ebextensihttps://github.com/Orcpub/orcpub/tree/develop/.expoonshttps://github.com/Orcpub/orcpub/trhttps://github.com/Orcpub/orcpub/tree/develop/assetsee/develop/.githubhttps://github.com/Orcpub/orcpub/tree/develop/bin/wkhtmltoxhttps://github.com/Orcpub/orcpub/tree/develop/deployhttps://github.com/Orcpub/orcpub/tree/develop/devhttps://github.com/Orcpub/orcpub/tree/develop/dockerhttps://github.com/Orcpub/orcpub/tree/develop/ehttps://github.com/Orcpub/orcpub/tree/develop/jsnvhttps://github.com/Orcpub/orcpub/tree/develop/native/cljs/orcpubhttps://github.com/Orcpub/orcpub/tree/develop/resourceshttps://github.com/Orcpub/orcpub/tree/develop/srchttps://github.com/Orcpub/orcpub/tree/develop/testhttps://github.com/Orcpub/orcpub/tree/develop/web/cljs/orcpubhttps://github.com/Orcpub/orcpub/blob/develop/.babelrchttps://github.com/Orcpub/orcpub/blob/develop/.dockerignorehttps://github.com/Orcpub/orcpub/blob/develop/.gitignorehttps://github.com/Orcpub/orcpub/blob/develop/.grenrc.jshttps://github.com/Orcpub/orcpub/blob/develop/.gitignorehttps://github.com/Orcpub/orcpub/blob/develop/.grenrc.jshttps://github.com/Orcpub/orcpub/blob/develop/.js-modules.ednhttps://github.com/Orcpub/orcpub/blob/develop/.grenrc.jshttps://github.com/Orcpub/orcpub/blob/develop/.travis.https://github.com/Orcpub/orcpub/blob/develop/LICENSEymlhttps://github.com/Orcpub/orcpub/blob/develop/Procfilehttps://github.com/Orcpub/orcpub/blob/develop/README.mdhttps://github.com/Orcpub/orcpub/blob/develop/docker-compose-build.yamlhttps://github.com/Orcpub/orcpub/blob/develop/docker-compose-build.yamlhttps://github.com/Orcpub/orcpub/blob/develop/exp.jsonhttps://github.com/Orcpub/orcpub/blob/develop/main.jshttps://github.com/Orcpub/orcpub/blob/develop/exp.jsonhttps://github.com/Orcpub/orcpub/blob/develop/main.jshttps://github.com/Orcpub/orcpub/blob/develop/package.jsonhttps://github.com/Orcpub/orcpub/blob/develop/project.clj

datdamnzotz and others added 30 commits September 7, 2025 16:21
…f-download

Add player name, class, level to the filename when downloading.
… null)

- aloof-sort-by: handle nils and non-strings before lower-casing
- ->kebab-case: guard for strings and use clojure.string/lower-case

Prevents TypeError: "toLowerCase" of null in cljs paths.
Fix: make lower-casing nil-safe in common.cljc
Fix URL string when fetching homebrew content
Fixes #639
Expand errors.cljc with reusable macros and utilities:
- log-error, create-error for structured exception creation
- with-db-error-handling macro for database operations
- with-email-error-handling macro for email operations
- with-validation macro for parsing/validation
- Error code constants for auth flows

Includes comprehensive test suite in errors_test.clj.
- datomic.clj: Structured errors for DB startup and connection
- email.clj: Error handling for SMTP config and send failures
- pdf.clj: Network timeouts (10s) and specific image load errors
- pdf_spec.cljc: Nil guards with fallback strings throughout PDF
  generation (traits, spells, resistances, proficiencies, damage)
- routes.clj: Error handling for verification, password reset,
  entity CRUD, and PDF parsing
- routes/party.clj: Error handling for all party operations
- system.clj: PORT validation on startup
import_validation.cljs (new):
- Unicode normalization (40+ char mappings) on import and save
- Required field detection and auto-fill with placeholders
- Trait and option validation with unique default names
- Multi-plugin format detection
- Pre-export validation with detailed issue reporting

content_reconciliation.cljs (new):
- Missing content detection for races, classes, subclasses
- Fuzzy key matching (Levenshtein, prefix, display name)
- Source inference from key structure
- Built-in content exclusions

common.cljc:
- kw-base for keyword base extraction
- traverse-nested for walking option structures

options.cljc:
- Use explicit :key field for renamed plugins

Includes unit tests and test fixtures.
views.cljs:
- Conflict resolution modal (rename/skip/replace per duplicate key)
- Export warning modal for missing required fields
- Nil character ID guard in character list
- Fuzzy match suggestions for missing content display

character_builder.cljs:
- Missing content warning banner with expandable details
- DOM IDs for testability (#missing-content-warning, etc.)

events.cljs:
- Import validation and conflict detection events
- Export validation with warning modal flow
- Fix nil nil root cause in set-class-path-prop
- Option auto-fill with unique default names
- Specific save error messages from spec failures

subs.cljs:
- Import log, conflict resolution, export warning subscriptions
- Missing content report and available content subscriptions

db.cljs: Import log and conflict resolution state maps
spell_subs.cljs: Defensive plugin data handling, key preservation
styles/core.clj: Warning banner CSS classes
core.cljs: Import log overlay mount, dev version logging
tools/orcbrew.clj (new):
- lein prettify-orcbrew <file> for pretty-printing EDN
- lein prettify-orcbrew <file> --analyze for issue detection
- Reports: nil-nil patterns, problematic Unicode, disabled
  entries, missing trait names, file structure summary
Linter configuration:
- .clj-kondo/config.edn: with-db macro and user ns exclusions
- .lsp/config.edn: Source paths to avoid scanning compiled CLJS

Feature documentation:
- docs/ERROR_HANDLING.md: Error macro usage and error codes
- docs/CONFLICT_RESOLUTION.md: Duplicate key detection and modal
- docs/CONTENT_RECONCILIATION.md: Missing content and fuzzy matching
- docs/HOMEBREW_REQUIRED_FIELDS.md: Required fields per content type
- docs/ORCBREW_FILE_VALIDATION.md: Import/export validation guide
- docs/README.md: Documentation index

CHANGELOG.md: Full changelog for this feature branch
…296)

Three-layer fallback in language-selection: language-map → corrections
shim → generated entry. Fixes primoridial typo with backwards-compat
shim. Adds tests (6 tests, 384 assertions) and documentation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The custom weapon dropdowns (Damage Die Number, Damage Die, Simple/Martial,
Melee/Ranged) were immediately resetting to default values after user
interaction, preventing users from selecting values.

Root cause: Default values were dispatched during component render via a
doseq block in views.cljs, overwriting user selections on every re-render.

Fix:
- Move default value initialisation from render phase to the
  ::mi/toggle-subtype event handler (events.cljs) so defaults are set
  once when "Custom" is first selected, not on every render cycle.
- Remove the problematic doseq dispatch block from views.cljs.
- Convert selection-adder to a Form-2 Reagent component with a local
  atom so the dropdown resets to the placeholder after each selection.
Extract remove-custom-weapon-fields and apply-subtype-toggle into
magic_items.cljc so they can be tested from JVM tests. Simplify the
reg-event-db handler in events.cljs to a one-liner delegating to the
extracted function.

Tests cover:
- Weapon field stripping (all 17 keys removed, non-weapon keys preserved)
- Custom (:other) defaults (die count, die, weapon type, melee/ranged)
- :all subtype toggle
- Named subtype add/remove and :other/:all cleanup
apply-subtype-toggle was writing defaults to ::mi/ keys instead of
::weapons5e/ keys, so custom weapon properties (damage die, type,
melee/ranged, damage type) were silently dropped during serialization.
Also fixes item-save-success to update the custom-items list in app-db
so saved items appear immediately without a page reload.
Adds missing Special and Loading checkboxes to the custom weapon
builder. Special was partially wired (schema + serialization) but
had no UI/events/subs. Loading is new end-to-end including tagging
existing weapons (crossbows, blowgun, firearms) per 5e PHB rules.
The PDF equipment fields were only looking up names from the base
equipment map, causing magic items to display as raw keywords. Merge
the magic items map into the lookup. Also ensure add-key populates
:name so custom items resolve correctly.
Dependency upgrades: Clojure 1.12.4, ClojureScript 1.12.134,
Pedestal 0.7.0, Datomic Pro 1.0.7482, React 18.3.1, Reagent 2.0.1,
re-frame 1.4.4, PDFBox 3.0.6, Buddy 3.x, figwheel-main 0.2.20,
java-time 1.4.2, and supporting library updates.

Key changes:
- Datomic Free -> Pro (Java 21 compatibility)
- Pedestal interceptor wrapping + CSP nonce handling (required by 0.7)
- React 18 createRoot migration
- clj-time -> java-time
- lein-figwheel -> figwheel-main
- CI updated to Java 21
- Devcontainer + scripts for Datomic Pro setup

74 tests, 237 assertions, 0 failures.
codeGlaze added 17 commits March 1, 2026 21:40
docker build tags images as orcpub-app/orcpub-datomic, but compose
defaults to Docker Hub names. Compose pulled old Datomic Free images,
causing :unsupported-protocol :dev at runtime. Set ORCPUB_IMAGE and
DATOMIC_IMAGE env vars so compose uses the locally-built Pro images.
- .gitattributes: merge=ours for fork/ files and devcontainer.json
- .gitignore: untrack .claude/, newrelic*, deploy/transactor.properties
- devcontainer.json: restore Docker-in-Docker feature (lost in cherry-pick)
…+ test suite

File-copy from dmv/hotfix-integrations with DMV branding stripped:
- docker-setup.sh: 372 → 1332 lines (--check, --build, --deploy, --upgrade, --secrets)
- docker-compose.yaml: aligned env vars, Docker Secrets docs, variable comments
- docker-user.sh: ANSI-C color quoting fix, tr -d '\r' for Windows line endings
- .env.example: separate DATOMIC_PASSWORD, image tag vars, generic branding placeholders
- test/docker/: 46-test suite (test-upgrade.sh) with 8 fixture .env scenarios
- .gitignore: add generated secrets files
Mirror of dmv/hotfix-integrations fork extraction. Shared source files
are now identical between branches — only fork/ files differ.

New fork/ files (community/public stubs):
- fork/auth.clj: 24h tokens, no login tracking
- fork/splash.cljc: community label, no generators
- fork/privacy_content.clj: standard privacy policy

Extended fork/ files:
- fork/branding.clj + .cljs: copyright-url (empty),
  registration-logo-class (h-55), restrict-print-to-owner? (false)

Shared files updated to consume fork/ values:
- routes.clj, views_2.cljc, views.cljs, privacy.clj, .gitattributes
Cherry-picked shared files from dmv/ — no merge commit, preserving
clean merge path for breaking/ → dmv/ sync.

Infrastructure: docker-setup.sh → run CLI redesign, Docker secrets,
nginx dev config, transactor template, compose CI workflow updates.

App: PDFBox 3.x migration, CSP extensibility, email error throttle,
config.clj secrets support, session token path fix, cookie consent.

Docs: DOCKER, ENVIRONMENT, ERROR_HANDLING, email-system, branding.

Assets: 6 SVGs, favicon, SRD PDF → dnld/, 5e actions reference,
build.bat, removed unreferenced logo variants.
12 files still referenced the old script name in comments,
error messages, and documentation.
Suppress intentional SC2016 (literal '${' check), SC2001 (regex too
complex for parameter expansion), fix SC2129 (grouped redirects).
- Remove PR comment step from CI (fork PRs lack write access, always 403)
- Update docker-integration password validation for new URL format
  (password no longer embedded in DATOMIC_URL, appended at runtime)
./run --auto (naked mode) now runs the full pipeline (setup→build→up).
The CI --force step regenerated passwords against an existing H2 database
created by the first run, causing "Unable to connect to embedded storage".

Add docker compose down + rm -rf data/ between setup validation steps
so CI's explicit build/start steps get a clean slate.
./run --swarm generates docker-compose.swarm.yaml and .env.portainer
as text files — no Docker daemon required. The generated compose uses
named volumes, overlay networks, deploy sections with resource limits,
rolling updates, and commented Traefik labels.

Upgrade path: detects existing swarm compose, backs it up, extracts
customizations (Traefik labels, resource limits, env values, networks,
stack name), regenerates with latest template preserving admin config,
and shows a colorized diff (white/cyan/green/yellow).

.env.portainer is a flat KEY=VALUE file (no comments, no blanks, no
COMPOSE_FILE) ready to paste into Portainer's Advanced mode editor.

./run --swarm --secrets activates Swarm Raft secrets (uncomments
secrets blocks in the generated compose).

Also fixes:
- docker-user.sh: flexible Swarm container discovery (label matching)
- Secret file permissions: 644 (non-root container user needs read)
- .gitignore: generated swarm/portainer files excluded

60 tests, 0 failures (14 new swarm tests).
Rewrite Docker Swarm Deployment section to cover:
- ./run --swarm generates text files (no daemon dependency)
- Compose vs Swarm comparison table
- Quick start with CLI deploy
- Portainer import workflow (Advanced mode paste)
- Upgrade behavior with colorized diff
- JVM memory guidance (MaxRAMPercentage vs explicit heap)
- File-based vs Swarm Raft secrets as distinct paths
- File inventory updated with new generated files
shellcheck needs -x to follow sourced files (scripts/swarm.sh from run).
Use --severity=warning to skip intentional info-level findings:
- SC2016: single-quoted ${VAR} templates are literal by design
- SC2094: heredoc-to-file is not a read+write pipeline
- SC2154: color_* vars defined by sourcing script, suppressed via directive

Also adds scripts/swarm.sh to the lint targets.
datdamnzotz and others added 12 commits March 13, 2026 11:41
…y, dead code

- Create fork/splash.cljc with DMV generator entries (13 generators)
- Create fork/privacy_content.clj with full CCPA/GDPR privacy policy
- Wire privacy.clj to use fork/privacy_content reference
- Comment out unused share-link-email function
- Remove dead cljs-time require
…focus

Each header tab had its own Reagent atom controlling flyout visibility.
On mobile, opening one tab couldn't close another since atoms were
independent. Also no way to dismiss by tapping outside.

Replace with CSS :hover (desktop) and :focus-within (mobile tap).
Focus is inherently exclusive — opening one tab blurs the previous.
Tapping outside naturally blurs, closing all flyouts.

- Remove per-tab hovered? atoms from header-tab and header-tab2
- Add .header-flyout CSS class: hidden by default, shown on :hover/:focus-within
- Add tabindex=0 for focusability, mousedown handler for tap-to-toggle
- Flyout items call .blur() on click to dismiss after navigation
Adjacent header-tab elements create competing stacking contexts via
position:relative, causing their SVG icons to paint over the dropdown.
Elevate the hovered/focused tab's z-index above siblings.
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.

4 participants