Skip to content

feat(livesolutions): hierarchy collapse default, bootstrap, and lag fixes - #162

Open
LiveSolutionsBeast wants to merge 14 commits into
opf:stable/17from
LiveSolutionsBeast:feat/hierarchy-collapse-bootstrap
Open

feat(livesolutions): hierarchy collapse default, bootstrap, and lag fixes#162
LiveSolutionsBeast wants to merge 14 commits into
opf:stable/17from
LiveSolutionsBeast:feat/hierarchy-collapse-bootstrap

Conversation

@LiveSolutionsBeast

Copy link
Copy Markdown

Summary

This PR bundles three Live Solutions customizations against OpenProject stable/17 so they are preserved through future base-image updates:

  1. Hierarchy collapse default + backend persistence (#777 / #778)

    • Adds UserHierarchyCollapseState model/table and GET/POST /api/v3/livesolutions_hierarchy_state API.
    • Seeds all existing users with all_collapsed: true and ensures new users get the same default via after_create.
    • Patches UserPreference to default per_page to 100 and QueryParamsRepresenter.default_hash to return pageSize: 100.
    • Injects hierarchy-collapse-all.js runtime patch via _favicons.html.erb and a new work_packages/index.html.erb bootstrap that emits the per-user collapsed state as a <meta> tag so the table can load collapsed before Angular finishes rendering.
  2. Proxy host header fix

    • Forces the internal Caddy proxy to send Host: projects.livesolutionsnow.com upstream, fixing OpenProject's host-name validation for internal requests.
  3. Relation lag respects successor ignore_non_working_days

    • Adds AllDaysLagPatch and RelationLagPatch, wired into the Livesolutions engine, so lag is interpreted as calendar days when the successor ignores non-working days.

Upgrade / update-proofing notes

  • All changes live under custom-plugin/openproject-livesolutions/ or in proxy/Caddyfile; no core container files are modified.
  • On the next OpenProject image update, rebuild the custom image and run rails db:migrate to apply 20260825210000_create_user_hierarchy_collapse_states.rb.
  • Bind mounts in docker-compose.override.yml continue to serve the patched JS/CSS/ERB assets without requiring a full rebuild for frontend-only tweaks.

Verification

  • Backend: 14 user rows created; /api/v3/livesolutions_hierarchy_state returns/updates {all_collapsed, collapsed_ids}.
  • Pagination: /api/v3/projects/1/work_packages returns pageSize: 100.
  • Runtime: production access logs show POST /api/v3/livesolutions_hierarchy_state returning 201 for real users.
  • End-user visual verification confirmed by reporter.

Dependencies

  • Requires a container rebuild for the Rails-side model/API/migration additions.
  • Requires rails db:migrate after first deploy.

Live Solutions Beast added 14 commits July 1, 2026 23:15
…patibility, rollback

Adds upgrade orchestrator (scripts/upgrade.sh) with dry-run, pre/post feature compatibility checks, automatic offline backup, and rollback on failure.

Adds health-check.sh, feature-check.sh, backup-logical.sh, and control-plane restore service.

Updates control plane to postgres:17 and makes DB upgrade version-agnostic.

Protects custom theme, CF SSO, premium feature unlock, SMTP relay, proxy config, and secrets during git pull.

Documents hardening in docs/UPGRADE_HARDENING.md and includes docs/PREMIUM_FEATURE_UNLOCK_PLAN.md.
- proxy/Caddyfile: add /healthz bypass endpoint for external monitoring.
- docker-compose.override.yml: add restart/healthcheck/autoheal for web,
  restart policy for autoheal, healthchecks for proxy and hocuspocus.
- scripts/health-check.sh: verify public /healthz bypass endpoint.
- Cloudflare: enable Always Use HTTPS; add Access bypass policy for /healthz
  and reorder policies so bypass runs first.
…itoring

- Remove /healthz bypass on projects.livesolutionsnow.com that broke Cloudflare Access
  Azure AD auto-redirect; move public health check to status.livesolutionsnow.com/healthz
- Re-enable auto_redirect_to_identity and single Azure AD IdP for the Access app
- Add status.livesolutionsnow.com DNS record and tunnel route (no Access)
- Add scripts/global-health-check.sh to monitor all public tunnel endpoints
…ration

Raise container memory limits after observing web at 99.45% of 2 GiB
and worker at 81% of 1 GiB, causing GC thrashing, slow requests, and
export failures.

- db: 1G -> 2G (headroom for upcoming Postgres tuning)
- web: 2G -> 4G (Rails + plugins breathing room)
- worker: 1G -> 2G (background job / export headroom)

Also creates /var/openproject/assets/files with uid 1000 ownership so
attachment and work-package exports can write successfully.
Apply Postgres memory tuning now that the DB container limit is 2 GiB.
Previous defaults were sized for a tiny container: 128 MB shared_buffers,
4 MB work_mem, 64 MB maintenance_work_mem, causing sluggish query planning
and slow maintenance on a 62 GiB host.

New settings for the 2 GiB DB container:
- shared_buffers = 512MB  (25% of container RAM)
- work_mem = 16MB           (was 4MB; helps sorts/hashes)
- effective_cache_size = 1GB (planner hint, not allocation)
- maintenance_work_mem = 256MB (was 64MB; speeds VACUUM/CREATE INDEX)
…ark\n\n- Add generated LS brand assets under openproject-config/branding/generated\n (full logo dark/light, icon mark dark/light, favicon, apple-touch-icon).\n- Override Rails _inline_css_logo.erb and _favicons.html.erb to point to\n /livesolutions-branding/ assets, bypassing fingerprinted asset pipeline.\n- Update livesolutions theme.css to use local LS brand assets.\n- Mount assets into web/worker/cron and proxy; route /livesolutions-branding/*\n and /favicon.ico directly through Caddy so static files serve in production.\n- Replaces OpenProject logo in header, mobile icon, and PDF exports.
…e and enlarge PDF export logo\n\n- Replace low-res web-downloaded assets with source files from\n SharePoint Solutions Central: logo-2D-bluegradient-logomark.png (dark)\n and logo-white-2D-bluegradient-logomark.png (light).\n- Regenerate all brand assets at high resolution:\n - logo_openproject.png / logo_openproject_white_big.png: 2400x420\n - icon_logo.png / icon_logo_white.png: 1024x1024\n - favicon.ico, apple-touch-icon-120x120.png from cube mark\n- Add initializer ls_pdf_logo_size.rb to raise default PDF export logo\n height from 25 pt to 60 pt on covers and 20 pt to 35 pt on page\n headers, so the full LS logo is readable on all exports.
…\n- Widen .op-logo container from 130px to 260px and let .op-logo--link\n fill it, so the full LS wordmark is no longer clipped.\n- Keep .op-logo--icon mark at 48px so the cube stays proportionate.\n- Raise max-height to 55px and align both inline CSS and theme.css.
… mark\n\n- Remove the full LS wordmark background from the desktop header link\n while keeping the link element and layout intact.\n- Keep the LS cube mark as the header icon.\n- Leave all other LS branding unchanged: favicon, apple-touch-icon,\n PDF/CSV export logos, and the Caddy/proxy mounts.
…eplace desktop header wordmark with the LS cube mark (icon_logo).\n- Keep header layout intact; do not hide the logo link element.\n- Replace homescreen organization-name text header with the LS logo\n image at 60px height.\n- Mount homescreen view override into the web container.
- Request #777: add runtime hierarchy collapse-all/expand-all buttons to
  the work-packages table. New JS patch lives at
  custom-plugin/openproject-livesolutions/app/assets/javascripts/livesolutions/hierarchy-collapse-all.js,
  injected via the existing _favicons.html.erb view override. Uses the
  upstream WorkPackageViewHierarchiesService public collapse()/expand()
  methods and falls back to synthesized indicator clicks.

- Request #778: expand per-page options to 20, 100, 250, 500 and default
  fresh visitors to 100. Runtime JS patch at
  custom-plugin/openproject-livesolutions/app/assets/javascripts/livesolutions/pagination-default.js
  clears stale localStorage values and seeds the default.

- Infrastructure: add Caddy /javascripts/livesolutions/* file_server route
  and docker-compose bind mounts so both patches are hot-swappable without
  rebuilding the OpenProject image.

- Also updates the livesolutions plugin engine to register the JS assets
  path and appends matching toolbar CSS to theme.css.

Note: .env requires OPENPROJECT_PER__PAGE__OPTIONS=20, 100, 250, 500
(gitted separately).
…#778

- Add UserHierarchyCollapseState model, migration, and API endpoint
  /api/v3/livesolutions_hierarchy_state for per-user backend persistence.
- Patch QueryParamsRepresenter and UserPreference to default pageSize to 100.
- Add after_create hook on User to seed default collapsed state for new users.
- Inject runtime JS via _favicons.html.erb override with DOM-based restore,
  per-click fallback, and MutationObserver for individual toggle sync.
- Bootstrap per-user hierarchy state into work_packages/index.html.erb via a
  CSP-safe meta tag, eliminating the initial API round-trip and flicker.
- Mount the new view override and public JS in docker-compose.override.yml.
- Update health-check.sh and UPGRADE_HARDENING.md documentation.
…orking_days flag

- Patch WorkPackages::Shared::AllDays to compute lag as calendar days.
- Patch Relation#successor_soonest_start to use the successor's day
  computation mode when applying lag.
- Wire both patches into the Livesolutions engine and patch loader.
@LiveSolutionsBeast
LiveSolutionsBeast marked this pull request as ready for review August 26, 2026 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant