Skip to content

fix(OUT-4032): gate actions widget on content only - #235

Merged
SandipBajracharya merged 1 commit into
mainfrom
OUT-4032
Aug 11, 2026
Merged

fix(OUT-4032): gate actions widget on content only#235
SandipBajracharya merged 1 commit into
mainfrom
OUT-4032

Conversation

@SandipBajracharya

Copy link
Copy Markdown
Collaborator

Linear: OUT-4032

Follow-up to the merged #233. Net change vs main is the content-only gating fix for the "Your actions" widget.

Changes

  • Gate ActionsCard on !isDefaultContent(content) at all three render sites (IU editor, IU preview, CU client), dropping the earlier createdAt === updatedAt "never saved" check.
  • Removed the now-unused isNeverSaved / isDefaultClientHome helpers and the timestamp store reads.

Why

The timestamp check was wrong for segments. A new segment duplicates the workspace's default settings via duplicateDefaultSettingscreateForSegment, which is a fresh INSERT, so createdAt === updatedAt even when the copied content is already personalized. That made isNeverSaved true and wrongly hid the actions widget on customized segment homes. Content comparison is the correct signal.

Testing Criteria

  • pnpm typecheck — passes.
  • pnpm lint — passes, 0 warnings.
  • Manual: edit + save the default home, create a segment → segment home shows ActionsCard (was hidden before this fix). Fresh/untouched default home still hides it. Loom to be added.

Impact & Surface Area of Change

  • Only affects the visibility condition for ActionsCard on the client home (IU editor, IU preview, CU client). No data/schema/API changes.
  • Relies on content === defaultContent; the single-line defaultContent (from OUT-4032: update default client home copy #233) keeps this reliable after TipTap re-serialization.

@linear-code

linear-code Bot commented Aug 11, 2026

Copy link
Copy Markdown

OUT-4032

@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
client-home-v3 Ready Ready Preview Aug 11, 2026 9:36am

Request Review

Drop the never-saved timestamp check: a segment duplicated from a
customized default is a fresh insert (createdAt === updatedAt) yet its
content is already personalized, so the timestamp check wrongly hid the
card. Rely on isDefaultContent alone.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown

Greptile Summary

The PR updates the seeded client-home copy and banner, changes the subheading database default, and gates ActionsCard solely by comparison with the current default body HTML.

  • Adds content-only ActionsCard visibility checks to the editor, preview, and client views.
  • Replaces the default body and greeting subheading copy.
  • Updates the default banner path and generated migration metadata.

Confidence Score: 4/5

The PR should not merge until existing untouched homes containing the previous default body are kept from showing ActionsCard.

The content-only gate compares persisted content against only the newly introduced default string, so historical untouched settings take the customized-content branch at every ActionsCard render site.

Files Needing Attention: src/features/editor/utils/content.ts and src/features/settings/constants.ts

Important Files Changed

Filename Overview
src/features/editor/utils/content.ts Adds strict current-default equality detection, which misclassifies untouched rows containing the previous persisted default.
src/features/editor/components/EditorWrapper.tsx Applies content-only ActionsCard gating in editor and preview entry points but inherits historical-content misclassification.
src/features/editor/components/ClientEditorWrapper.tsx Applies the same gate to the client-facing view, exposing the historical-default regression to clients.
src/features/editor/components/Preview/Preview.tsx Gates preview ActionsCard visibility consistently with the other render sites.
src/features/settings/constants.ts Replaces the canonical body and subheading defaults without preserving recognition of the prior body default.
src/db/migrations/20260810044541_update-default-client-home-subheading.sql Correctly changes the database default for future subheading inserts without modifying existing rows.

Reviews (1): Last reviewed commit: 2a9deb9 | Re-trigger Greptile

@@ -9,16 +9,3 @@ export const isBlankContent = (html?: string): boolean => {

// True when the body still matches the seeded default copy.
export const isDefaultContent = (html?: string): boolean => html === defaultContent

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Historical defaults bypass the gate

When an existing workspace or segment still contains the previous untouched default HTML, isDefaultContent compares it only with the new default string and returns false, causing ActionsCard to appear on an untouched client home.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is intended. The change takes place only for newly created workspace.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Got it, that makes sense. Existing workspaces with the old default HTML will show ActionsCard, and only newly created workspaces get the new gating behavior. Thanks for clarifying!

Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.

@priosshrsth priosshrsth left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@SandipBajracharya
SandipBajracharya merged commit a5a107e into main Aug 11, 2026
7 checks passed
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.

2 participants