Skip to content

Add conditional additional settings to the hero block#600

Merged
woodwoerk merged 7 commits into
mainfrom
feat/additional-settings-hero-block
Jun 9, 2026
Merged

Add conditional additional settings to the hero block#600
woodwoerk merged 7 commits into
mainfrom
feat/additional-settings-hero-block

Conversation

@woodwoerk

Copy link
Copy Markdown
Contributor

Description

Screenshots/Videos (if applicable)

Screen recording in Drive

Related issue

Asana ticket

Requirements, dependencies and related PRs

kausaltech/kausal-backend-common#92


✅ Pre-Merge Checklist

Type of Change

  • Set the PR's label to match the nature of this change

Testing

  • Built Unit tests (unit tests added/updated)
  • Built E2E tests (if applicable. E2E tests added/updated)
  • Authorization is tested (permissions and access controls verified)
  • Manually tested locally (functionality verified)
    Manual testing instructions
    If feature requires manual testing by reviewer, you can provide instructions here.

Internationalization & Accessibility

  • New strings are translatable (all user-facing text uses i18n)
  • Accessibility standards met (WCAG compliance, screen reader support)

Integrations (if applicable)

If there are model changes to models which use any of the features below, verify the new models work together with the features.
For example, when adding a new model, verify the new model instances are copied when copying a plan.

  • Moderation integration implemented
  • Reporting integration implemented
  • Copy plan feature integration implemented
  • Umbrella plan structure integration implemented

Dependencies

  • Dependencies are merged (if applicable. If the change depends on other PRs e.g. kausal_common)

@woodwoerk woodwoerk requested a review from tituomin May 25, 2026 14:23
@woodwoerk woodwoerk added the New feature New feature (non-breaking change which adds functionality) label May 25, 2026
@kausal-code-coverage

kausal-code-coverage Bot commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.55556% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pages/blocks.py 80.55% 7 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #600      +/-   ##
==========================================
+ Coverage   62.65%   62.66%   +0.01%     
==========================================
  Files         387      387              
  Lines       40949    40983      +34     
  Branches     5235     5238       +3     
==========================================
+ Hits        25657    25684      +27     
- Misses      13682    13689       +7     
  Partials     1610     1610              
Flag Coverage Δ
e2e-tests 8.60% <0.00%> (-0.01%) ⬇️
unittests 60.00% <80.55%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pages/blocks.py 79.31% <80.55%> (+0.02%) ⬆️

Impacted file tree graph

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@woodwoerk woodwoerk force-pushed the feat/additional-settings-hero-block branch 2 times, most recently from 15574ef to 2c7d9a6 Compare June 1, 2026 13:36
@tituomin tituomin force-pushed the feat/additional-settings-hero-block branch from fceb647 to 6f009c0 Compare June 3, 2026 12:37
@woodwoerk woodwoerk marked this pull request as ready for review June 8, 2026 05:55
@woodwoerk woodwoerk force-pushed the feat/additional-settings-hero-block branch from fc4782e to a620c42 Compare June 9, 2026 06:17

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a620c42607

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread pages/blocks.py
data = getattr(root, 'value', root)
if data.get('layout') not in _LAYOUTS_WITH_ADDITIONAL_SETTINGS:
return None
return data.get('additional_settings')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve defaults for existing small-image heroes

When a page already contains a front_page_hero saved before this migration with layout='small_image', the stored StreamField JSON has no additional_settings key because the migration only alters the block schema. This resolver therefore returns null for a layout that now exposes additional settings, so existing heroes do not receive the new defaults such as fit_image=True unless every page is manually resaved or the resolver/data migration synthesizes the default settings.

Useful? React with 👍 / 👎.

@woodwoerk woodwoerk merged commit e96ccca into main Jun 9, 2026
15 checks passed
@woodwoerk woodwoerk deleted the feat/additional-settings-hero-block branch June 9, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New feature New feature (non-breaking change which adds functionality)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants