Skip to content

[codex] strengthen bionify controls and settings#864

Merged
jeffscottward merged 6 commits intoRunMaestro:mainfrom
jeffscottward:codex/bionify-polish-intensity
Apr 19, 2026
Merged

[codex] strengthen bionify controls and settings#864
jeffscottward merged 6 commits intoRunMaestro:mainfrom
jeffscottward:codex/bionify-polish-intensity

Conversation

@jeffscottward
Copy link
Copy Markdown
Contributor

@jeffscottward jeffscottward commented Apr 18, 2026

Summary

This PR tightens the Bionify desktop experience across the three surfaces from the screenshots and adds stronger configuration controls.

  • normalizes the B toggle geometry in File Preview and Auto Run so it matches adjacent toolbar buttons
  • replaces the weak fixed Bionify transform with a configurable algorithm and intensity-driven emphasis/rest styling
  • adds Display settings controls for Bionify intensity and algorithm, plus an info modal seeded from the upstream Bionify spec
  • expands Electron verification with before/after screenshots for settings, File Preview, Auto Run, and AI Chat

Root Cause

The original implementation had two separate problems:

  1. The toolbar buttons reused inconsistent sizing patterns, so the text-only B controls rendered taller and visually narrower than neighboring icon buttons.
  2. The reading-mode renderer used a hard-coded low-contrast emphasis model (font-weight: 600, high rest opacity, fixed 1-4 character emphasis) that produced almost no perceptible change in real UI surfaces.

Impact

  • File Preview and Auto Run toggles now read as first-class toolbar controls instead of odd one-off pills.
  • AI Chat, File Preview, and Auto Run now show materially stronger Bionify emphasis when enabled.
  • Users can tune Bionify behavior directly in Display settings without editing code.

Screenshot Artifacts

  • docs/screenshots/bionify-settings-default.png
  • docs/screenshots/bionify-settings-info.png
  • docs/screenshots/bionify-file-preview-before.png
  • docs/screenshots/bionify-file-preview-after.png
  • docs/screenshots/bionify-autorun-before.png
  • docs/screenshots/bionify-autorun-after.png
  • docs/screenshots/bionify-ai-chat-before.png
  • docs/screenshots/bionify-ai-chat-after.png

Validation

  • npx vitest run src/__tests__/renderer/utils/bionifyReadingMode.test.tsx src/__tests__/renderer/components/FilePreview.test.tsx src/__tests__/renderer/components/AutoRunDocumentSelector.test.tsx src/__tests__/renderer/components/Settings/tabs/DisplayTab.test.tsx
  • MAESTRO_WRITE_DURABLE_SCREENSHOTS=true npx playwright test e2e/bionify-reading-mode.spec.ts
  • npm run lint
  • npm run lint:eslint (passes with one unrelated pre-existing warning in src/main/web-server/web-server-factory.ts)
  • pre-push npm run validate:push

Summary by CodeRabbit

  • New Features

    • Bionify settings UI: intensity presets, editable algorithm, info modal; persisted and applied across reading mode, file previews, terminal output, auto-run flows, and AI Chat surface.
    • Markdown/terminal rendering now reflects configurable intensity and algorithm for emphasis/rest styling.
  • Tests

    • Expanded unit and e2e coverage for Bionify rendering, settings validation, UI flows, visual before/after comparisons, and AI Chat interactions.
  • Style

    • Unified toolbar button sizing for consistent geometry across controls.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1f907d00-724f-4e45-a9a9-938c27347a4e

📥 Commits

Reviewing files that changed from the base of the PR and between 470c5d8 and 8fcc24a.

📒 Files selected for processing (1)
  • src/renderer/components/Settings/tabs/DisplayTab.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/components/Settings/tabs/DisplayTab.tsx

📝 Walkthrough

Walkthrough

Adds persisted Bionify settings (intensity, algorithm), UI controls and validation, algorithm-driven per-word emphasis with CSS-variable styling, threads settings through markdown/preview/terminal renderers, updates components/styles, and expands unit and E2E tests including an AI chat flow.

Changes

Cohort / File(s) Summary
Settings infra & metadata
src/renderer/stores/settingsStore.ts, src/renderer/hooks/settings/useSettings.ts, src/shared/settingsMetadata.ts
Add persisted bionifyIntensity and bionifyAlgorithm, clamped setter, hook accessors, and metadata entries.
Settings UI
src/renderer/components/Settings/tabs/DisplayTab.tsx
Add Intensity presets (Soft/Default/Strong), algorithm text input with draft/validation, Info modal, and wiring to new setters.
Bionify core & styles
src/renderer/utils/bionifyReadingMode.tsx
Major refactor: algorithm parsing, per-word emphasis length, common-word skipping, normalized config API, CSS-variable style generation, theme support, and test style-reset helper.
Markdown pipeline
src/renderer/utils/markdownConfig.ts, src/renderer/components/MarkdownRenderer.tsx
Expose bionifyIntensity/bionifyAlgorithm options/props and forward into readable-text transforms/Bionify components; include Bionify styles in terminal prose.
Component integrations & UI polishing
src/renderer/components/FilePreview.tsx, src/renderer/components/AutoRun.tsx, src/renderer/components/TerminalOutput.tsx, src/renderer/components/AutoRunDocumentSelector.tsx
Thread settings into render paths and memo deps, update BionifyTextBlock props, unify toolbar button geometry classes, remove unused icon import.
API surface / types
src/renderer/components/MarkdownRenderer.tsx, src/renderer/components/TerminalOutput.tsx
Add optional bionifyIntensity/bionifyAlgorithm props to MarkdownRenderer types; add bionify props to LogItemProps and memo deps.
Tests & E2E
src/__tests__/renderer/..., src/__tests__/renderer/utils/bionifyReadingMode.test.tsx, e2e/bionify-reading-mode.spec.ts
Expand unit tests for DisplayTab, toolbar geometry, algorithm-driven segmentation, CSS-variable assertions, reset test styles; E2E adds AI Chat fixture, extensive settings interactions/screenshots, preview/autorun bounding-box checks, and computed-style assertions.

Sequence Diagram(s)

sequenceDiagram
  participant User as User
  participant UI as DisplayTab / FilePreview / Terminal UI
  participant Store as SettingsStore
  participant Renderer as MarkdownRenderer
  participant Style as StyleInjector

  User->>UI: change Intensity / edit Algorithm
  UI->>Store: setBionifyIntensity(value), setBionifyAlgorithm(string)
  Store-->>UI: persisted state updated
  UI->>Renderer: render (reads store via hook)
  Renderer->>Style: applyReadableTextTransforms(intensity, algorithm)
  Style-->>Renderer: inject CSS vars / scoped styles
  Renderer->>UI: render Bionify-marked nodes
  UI-->>User: emphasized text (fontWeight / opacity)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested labels

approved

Poem

🐰 I nibble letters, tweak the light,
Algorithms hop and make words bright,
CSS vars hum, intensity in sight,
Emphasis bounces, soft or strong at night,
Bionify blossoms — a rabbit’s delight.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[codex] strengthen bionify controls and settings' directly summarizes the main change: enhancing and reinforcing Bionify feature controls and their associated settings throughout the UI.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jeffscottward jeffscottward force-pushed the codex/bionify-polish-intensity branch from d4d71c0 to bc428a8 Compare April 18, 2026 20:42
@jeffscottward jeffscottward marked this pull request as ready for review April 18, 2026 21:57
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 18, 2026

Greptile Summary

This PR strengthens the Bionify reading-mode feature by replacing the original hard-coded emphasis model (font-weight: 600, fixed opacity) with a configurable algorithm string and intensity slider that drive CSS custom properties (--bionify-emphasis-weight, --bionify-rest-opacity) at render time. It also normalises toolbar button geometry across File Preview and Auto Run, and adds an info modal in Display Settings.

All remaining findings are P2 (no blocking bugs): the algorithm free-text field silently falls back to defaults on invalid input without user feedback, the info-modal description of the fallback fraction says "fraction of words" where it should say "fraction of characters", and the module-level style-injection flag can cause test-ordering sensitivity.

Confidence Score: 5/5

Safe to merge; all findings are P2 style/UX improvements with no runtime correctness impact.

No P0/P1 defects found. The algorithm parser falls back gracefully on malformed input, CSS variable cascade is correctly scoped, dependency arrays in both AutoRun useMemo blocks are complete, and the settings metadata defaults are consistent with the UI presets.

src/renderer/components/Settings/tabs/DisplayTab.tsx (algorithm input validation and info-modal copy); src/renderer/utils/bionifyReadingMode.tsx (module-level injection flag in tests).

Important Files Changed

Filename Overview
src/renderer/utils/bionifyReadingMode.tsx Core rewrite: replaces hard-coded emphasis model with configurable algorithm + intensity-driven CSS variables; introduces module-level style-injection singleton that can cause test ordering issues.
src/renderer/components/Settings/tabs/DisplayTab.tsx Adds Intensity toggle and free-text Algorithm input for Bionify; algorithm field has no validation feedback and its help modal contains a misleading description of the fallback fraction.
src/shared/settingsMetadata.ts Registers bionifyIntensity (number, default 1) and bionifyAlgorithm (string, default '- 0 1 1 2 0.4') in the settings registry; straightforward addition.
src/renderer/components/AutoRunDocumentSelector.tsx Normalises toolbar button sizing to inline-flex h-10 min-w-10 items-center justify-center across all four toolbar buttons for visual consistency.
src/renderer/components/AutoRun.tsx Threads bionifyIntensity and bionifyAlgorithm from the store into both markdown config useMemo blocks; dependency arrays correctly updated.
src/renderer/components/FilePreview.tsx Passes bionifyIntensity and bionifyAlgorithm into the markdown renderer config; removes unused Wand2 icon import.
src/tests/renderer/utils/bionifyReadingMode.test.tsx Good test coverage for disabled/enabled states, algorithm parsing, common-word skipping, tag skipping, and CSS variable injection; style assertions are correct.
e2e/bionify-reading-mode.spec.ts Expands E2E coverage with before/after screenshot captures for settings, File Preview, Auto Run, and AI Chat surfaces.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Store["settingsStore\n(bionifyReadingMode\nbionifyIntensity\nbionifyAlgorithm)"]
    DisplayTab["DisplayTab\n(Reading Mode toggle\nIntensity slider\nAlgorithm input)"]
    AutoRun["AutoRun.tsx"]
    FilePreview["FilePreview.tsx"]
    MarkdownConfig["markdownConfig.ts\n(BionifyRenderConfig)"]
    BionifyUtil["bionifyReadingMode.tsx\nnormalizeBionifyConfig()\nparseBionifyAlgorithm()\nbuildBionifyCssVars()"]
    BionifyText["BionifyText /\nBionifyTextBlock\n(CSS vars on span/div)"]
    CSSVars["CSS Variables\n--bionify-emphasis-weight\n--bionify-rest-opacity"]
    StyleTag["Injected style tag\n(singleton)"]

    DisplayTab -->|read/write| Store
    AutoRun -->|reads| Store
    FilePreview -->|reads| Store
    AutoRun -->|passes config| MarkdownConfig
    FilePreview -->|passes config| MarkdownConfig
    MarkdownConfig -->|BionifyRenderConfig| BionifyUtil
    BionifyUtil --> BionifyText
    BionifyText --> CSSVars
    BionifyUtil --> StyleTag
Loading

Reviews (1): Last reviewed commit: "docs: refresh bionify verification scree..." | Re-trigger Greptile

Comment thread src/renderer/components/Settings/tabs/DisplayTab.tsx
Comment thread src/renderer/components/Settings/tabs/DisplayTab.tsx
Comment thread src/renderer/utils/bionifyReadingMode.tsx
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/renderer/components/FilePreview.tsx (1)

936-996: ⚠️ Potential issue | 🟠 Major

Include Bionify settings in the memo dependencies.

bionifyIntensity and bionifyAlgorithm are read from useSettingsStore and passed to createMarkdownComponents (lines 943–944), but the dependency array omits them. When the user changes Display settings, markdown previews continue rendering with stale Bionify values.

Proposed fix
 		}, [
 			effectiveBionifyReadingMode,
+			bionifyIntensity,
+			bionifyAlgorithm,
 			onFileClick,
 			theme,
 			cwd,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/renderer/components/FilePreview.tsx` around lines 936 - 996, The memo for
markdownComponents omits bionifyIntensity and bionifyAlgorithm from its
dependency array, causing stale Bionify settings; update the useMemo dependency
list for markdownComponents to include bionifyIntensity and bionifyAlgorithm so
that createMarkdownComponents is re-run when those settings change (refer to
markdownComponents, createMarkdownComponents, bionifyIntensity, bionifyAlgorithm
and the useMemo dependency array).
🧹 Nitpick comments (3)
src/renderer/utils/bionifyReadingMode.tsx (1)

125-128: Nit: drop the redundant * 1.

(intensity - 1) * 1 is equivalent to (intensity - 1). Minor readability clean-up; the * 1 may look like a forgotten slope/scale placeholder.

♻️ Proposed diff
-	return Number(clamp(baseOpacity - (intensity - 1) * 1, 0.2, 0.9).toFixed(2));
+	return Number(clamp(baseOpacity - (intensity - 1), 0.2, 0.9).toFixed(2));
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/renderer/utils/bionifyReadingMode.tsx` around lines 125 - 128, In
function resolveBionifyRestOpacity remove the unnecessary multiplication by 1 in
the expression `(intensity - 1) * 1` — replace it with `(intensity - 1)` to
improve readability; confirm the logic remains the same and keep the clamp,
toFixed, and theme-based baseOpacity handling unchanged.
src/renderer/stores/settingsStore.ts (1)

1883-1983: Expose setBionifyIntensity / setBionifyAlgorithm from getSettingsActions() for parity.

The new setters are added to the store, but getSettingsActions() — which other non-React code paths use to mutate settings — still only exposes setBionifyReadingMode (line 1908). Add the two new setters next to it so the API surface stays consistent with the rest of the bionify trio.

♻️ Proposed diff
 		setBionifyReadingMode: state.setBionifyReadingMode,
+		setBionifyIntensity: state.setBionifyIntensity,
+		setBionifyAlgorithm: state.setBionifyAlgorithm,
 		setShowHiddenFiles: state.setShowHiddenFiles,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/renderer/stores/settingsStore.ts` around lines 1883 - 1983,
getSettingsActions() currently exposes setBionifyReadingMode but omits the new
setters setBionifyIntensity and setBionifyAlgorithm; update the returned object
in getSettingsActions to include state.setBionifyIntensity and
state.setBionifyAlgorithm (place them next to setBionifyReadingMode for parity)
so non-React code can mutate those bionify settings just like the others.
e2e/bionify-reading-mode.spec.ts (1)

327-337: Fragile B toolbar locator and strict dimension equality.

{ has: window.locator('span', { hasText: 'B' }) } uses substring matching, so any span whose text contains the character B (e.g., "Branch", "Build") will match, making .first()/.nth(1) rely on DOM ordering rather than identity. Prefer a more specific selector — e.g., getByTitle('Bionify reading mode') / getByRole('button', { name: /^B$/i }) / hasText: /^B$/ — so the test fails loudly if the toggle is renamed or reordered.

Additionally, toBe(...) on boundingBox().height/width is brittle against sub-pixel rendering differences. Consider toBeCloseTo(x, 0) to tolerate rounding while still asserting visual parity.

♻️ Example adjustment
-			const bionifyButtons = window
-				.locator('button')
-				.filter({ has: window.locator('span', { hasText: 'B' }) });
+			const bionifyButtons = window
+				.locator('button')
+				.filter({ has: window.locator('span', { hasText: /^B$/ }) });
@@
-			expect(filePreviewButtonMetrics[0]?.height).toBe(filePreviewButtonMetrics[1]?.height);
-			expect(filePreviewButtonMetrics[0]?.width).toBe(filePreviewButtonMetrics[1]?.width);
+			expect(filePreviewButtonMetrics[0]?.height).toBeCloseTo(filePreviewButtonMetrics[1]?.height ?? 0, 0);
+			expect(filePreviewButtonMetrics[0]?.width).toBeCloseTo(filePreviewButtonMetrics[1]?.width ?? 0, 0);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@e2e/bionify-reading-mode.spec.ts` around lines 327 - 337, The locator for the
"B" toolbar button (bionifyButtons / filePreviewBeforeButton) is fragile because
it uses substring matching via span hasText 'B' and .first(); replace that with
a precise selector such as getByTitle('Bionify reading mode') or
getByRole('button', { name: /^B$/i }) (or hasText: /^B$/) to target the intended
toggle explicitly, and change the strict equality assertions on
boundingBox().height/width to tolerant comparisons (e.g., use toBeCloseTo with
precision 0) when comparing filePreviewButtonMetrics to account for sub-pixel
rendering; keep the writeDurableScreenshot call and the getByTitle('Copy content
to clipboard') reference as-is.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/renderer/components/FilePreview.tsx`:
- Around line 936-996: The memo for markdownComponents omits bionifyIntensity
and bionifyAlgorithm from its dependency array, causing stale Bionify settings;
update the useMemo dependency list for markdownComponents to include
bionifyIntensity and bionifyAlgorithm so that createMarkdownComponents is re-run
when those settings change (refer to markdownComponents,
createMarkdownComponents, bionifyIntensity, bionifyAlgorithm and the useMemo
dependency array).

---

Nitpick comments:
In `@e2e/bionify-reading-mode.spec.ts`:
- Around line 327-337: The locator for the "B" toolbar button (bionifyButtons /
filePreviewBeforeButton) is fragile because it uses substring matching via span
hasText 'B' and .first(); replace that with a precise selector such as
getByTitle('Bionify reading mode') or getByRole('button', { name: /^B$/i }) (or
hasText: /^B$/) to target the intended toggle explicitly, and change the strict
equality assertions on boundingBox().height/width to tolerant comparisons (e.g.,
use toBeCloseTo with precision 0) when comparing filePreviewButtonMetrics to
account for sub-pixel rendering; keep the writeDurableScreenshot call and the
getByTitle('Copy content to clipboard') reference as-is.

In `@src/renderer/stores/settingsStore.ts`:
- Around line 1883-1983: getSettingsActions() currently exposes
setBionifyReadingMode but omits the new setters setBionifyIntensity and
setBionifyAlgorithm; update the returned object in getSettingsActions to include
state.setBionifyIntensity and state.setBionifyAlgorithm (place them next to
setBionifyReadingMode for parity) so non-React code can mutate those bionify
settings just like the others.

In `@src/renderer/utils/bionifyReadingMode.tsx`:
- Around line 125-128: In function resolveBionifyRestOpacity remove the
unnecessary multiplication by 1 in the expression `(intensity - 1) * 1` —
replace it with `(intensity - 1)` to improve readability; confirm the logic
remains the same and keep the clamp, toFixed, and theme-based baseOpacity
handling unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9685d534-ff0f-4e04-80bb-c78f12f83f0a

📥 Commits

Reviewing files that changed from the base of the PR and between 4498135 and bff1b19.

⛔ Files ignored due to path filters (8)
  • docs/screenshots/bionify-ai-chat-after.png is excluded by !**/*.png
  • docs/screenshots/bionify-ai-chat-before.png is excluded by !**/*.png
  • docs/screenshots/bionify-autorun-after.png is excluded by !**/*.png
  • docs/screenshots/bionify-autorun-before.png is excluded by !**/*.png
  • docs/screenshots/bionify-file-preview-after.png is excluded by !**/*.png
  • docs/screenshots/bionify-file-preview-before.png is excluded by !**/*.png
  • docs/screenshots/bionify-settings-default.png is excluded by !**/*.png
  • docs/screenshots/bionify-settings-info.png is excluded by !**/*.png
📒 Files selected for processing (16)
  • e2e/bionify-reading-mode.spec.ts
  • src/__tests__/renderer/components/AutoRunDocumentSelector.test.tsx
  • src/__tests__/renderer/components/FilePreview.test.tsx
  • src/__tests__/renderer/components/Settings/tabs/DisplayTab.test.tsx
  • src/__tests__/renderer/utils/bionifyReadingMode.test.tsx
  • src/renderer/components/AutoRun.tsx
  • src/renderer/components/AutoRunDocumentSelector.tsx
  • src/renderer/components/FilePreview.tsx
  • src/renderer/components/MarkdownRenderer.tsx
  • src/renderer/components/Settings/tabs/DisplayTab.tsx
  • src/renderer/components/TerminalOutput.tsx
  • src/renderer/hooks/settings/useSettings.ts
  • src/renderer/stores/settingsStore.ts
  • src/renderer/utils/bionifyReadingMode.tsx
  • src/renderer/utils/markdownConfig.ts
  • src/shared/settingsMetadata.ts

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@e2e/bionify-reading-mode.spec.ts`:
- Around line 472-479: The current assertions call window.evaluate and use
document.querySelectorAll('.bionify-word-emphasis') which counts Bionify spans
across the whole document; change these to scope to the AI chat snippet
container by first locating that container (e.g., via a stable selector/test-id
for the AI chat snippet) and then querying inside it (for example call
window.evaluate(() =>
document.querySelector('<ai-chat-container-selector>').querySelectorAll('.bionify-word-emphasis').length)
or get a locator/elementHandle for the chat container and run container.evaluate
to count/style-check only its children). Apply this change to the two places
that use '.bionify-word-emphasis' (the existing window.evaluate count and the
later style checks) so the assertions only inspect the AI chat surface.

In `@src/renderer/stores/settingsStore.ts`:
- Around line 618-625: The setter setBionifyIntensity currently clamps the
incoming value but doesn't guard against NaN or non-numeric persisted values,
allowing NaN to be stored and propagated; update setBionifyIntensity to first
coerce/validate the incoming value with Number(value) (or isFinite) and if it's
not a finite number fall back to a safe default (e.g., 1.0) before applying
Math.max/Math.min, then call set({ bionifyIntensity: safeValue }) and
window.maestro.settings.set('bionifyIntensity', safeValue); apply the same
finite-value guard pattern to the other occurrence around lines 1521–1525 where
bionifyIntensity is set from persisted data.

In `@src/renderer/utils/bionifyReadingMode.tsx`:
- Around line 304-320: BionifyText currently renders spans with inline CSS vars
but doesn't ensure the shared bionify stylesheet is injected and the stylesheet
rules are scoped to .bionify-text-block only, so standalone BionifyText can be
visually inert; update BionifyText to ensure the shared stylesheet is injected
when it mounts (same mechanism that BionifyTextBlock uses) and change or add
rules in that stylesheet so they also target the BionifyText span (the element
rendered by BionifyText) in addition to .bionify-text-block; reference the
BionifyText component, buildBionifyCssVars (for inline vars) and
renderBionifyChildren to locate the rendering logic and reuse the stylesheet
injection helper used by BionifyTextBlock.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fe7c5560-5b91-4734-b5cb-9222a4406844

📥 Commits

Reviewing files that changed from the base of the PR and between bff1b19 and c434747.

📒 Files selected for processing (7)
  • e2e/bionify-reading-mode.spec.ts
  • src/__tests__/renderer/components/Settings/tabs/DisplayTab.test.tsx
  • src/__tests__/renderer/utils/bionifyReadingMode.test.tsx
  • src/renderer/components/FilePreview.tsx
  • src/renderer/components/Settings/tabs/DisplayTab.tsx
  • src/renderer/stores/settingsStore.ts
  • src/renderer/utils/bionifyReadingMode.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/components/Settings/tabs/DisplayTab.tsx

Comment thread e2e/bionify-reading-mode.spec.ts
Comment thread src/renderer/stores/settingsStore.ts
Comment thread src/renderer/utils/bionifyReadingMode.tsx
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/renderer/utils/bionifyReadingMode.tsx`:
- Around line 334-372: BionifyTextBlock's explicit restOpacity is being
clobbered by the nested BionifyText which creates its own .bionify-text-block
and CSS vars; remove the inner wrapper and have BionifyTextBlock be the single
CSS-var scope by calling the low-level renderer (use renderBionifyChildren / the
same helper that BionifyText uses) instead of rendering <BionifyText>; keep
using normalizeBionifyConfig, buildBionifyCssVars and the blockClassName, apply
the restOpacity CSS var only on the outer div, and pass
enabled/intensity/algorithm into the render helper so children are rendered with
emphasis without adding another .bionify-text-block wrapper.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1ad86a1a-c14c-4c99-a794-f2a608bfc589

📥 Commits

Reviewing files that changed from the base of the PR and between c434747 and 6e4a2b9.

📒 Files selected for processing (3)
  • e2e/bionify-reading-mode.spec.ts
  • src/renderer/stores/settingsStore.ts
  • src/renderer/utils/bionifyReadingMode.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/stores/settingsStore.ts

Comment thread src/renderer/utils/bionifyReadingMode.tsx
@jeffscottward jeffscottward merged commit 72c67e4 into RunMaestro:main Apr 19, 2026
3 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Apr 29, 2026
6 tasks
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.

1 participant