Skip to content

🎨 Improved share modal to clamp long post previews#28966

Merged
peterzimon merged 2 commits into
mainfrom
weyland-des-1418-clamp-post-preview-from-share-modal
Jul 1, 2026
Merged

🎨 Improved share modal to clamp long post previews#28966
peterzimon merged 2 commits into
mainfrom
weyland-des-1418-clamp-post-preview-from-share-modal

Conversation

@weylandswart

Copy link
Copy Markdown
Contributor

Closes https://linear.app/ghost/issue/DES-1418/clamp-post-preview-from-share-modal

The share modal rendered the full post excerpt, which could run ~500 chars and overflow the modal with a scrollbar on shorter viewports. This PR fixes that at the source instead of patching it at each implementation.

Before After
Screenshot 2026-06-29 at 18 01 07 Screenshot 2026-06-29 at 18 00 44

closes https://linear.app/ghost/issue/DES-1418/clamp-post-preview-from-share-modal

- the share modal rendered the full post excerpt, which could run ~500 chars and overflowed the modal with a scrollbar on shorter viewports
- only the auto post-publish path capped it (truncated text to 100 chars in usePostSuccessModal); the analytics-header Share button and Stats latest-post passed the raw excerpt uncapped, so behaviour was inconsistent
- moved the bound into the shared PostShareModal component as a 2-line CSS clamp so every consumer behaves the same, and removed the now-redundant char truncation from the hook
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: edc6e08a-15c1-4de4-ae20-c183c978b5c0

📥 Commits

Reviewing files that changed from the base of the PR and between 9d205cd and 8925cb5.

📒 Files selected for processing (1)
  • apps/shade/src/components/posts-stats/post-share-modal.tsx
✅ Files skipped from review due to trivial changes (1)
  • apps/shade/src/components/posts-stats/post-share-modal.tsx

Walkthrough

The local truncateText helper in use-post-success-modal.ts is removed, and modalProps.postExcerpt now passes the raw post.excerpt value. In PostShareModal, the excerpt paragraph now uses line-clamp-2 to limit display to two lines.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: clamping long post previews in the share modal.
Description check ✅ Passed The description accurately describes the share modal overflow issue and the fix applied in this PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch weyland-des-1418-clamp-post-preview-from-share-modal

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.

@nx-cloud

nx-cloud Bot commented Jun 29, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 8925cb5

Command Status Duration Result
nx run @tryghost/admin-x-settings:test:acceptance ✅ Succeeded 10m 7s View ↗
nx run-many --target=build --projects=tag:publi... ✅ Succeeded <1s View ↗
nx run-many -t test:unit -p @tryghost/posts,@tr... ✅ Succeeded 7m 13s View ↗
nx run @tryghost/admin:build ✅ Succeeded 4m 40s View ↗
nx run ghost-admin:test ✅ Succeeded 3m 9s View ↗
nx run-many -t lint -p @tryghost/posts,@tryghos... ✅ Succeeded 1m 7s View ↗
nx run @tryghost/activitypub:test:acceptance ✅ Succeeded 58s View ↗
nx run ghost:build:assets ✅ Succeeded 2s View ↗
nx run ghost:build:tsc ✅ Succeeded 6s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-07-01 08:58:27 UTC

@peterzimon
peterzimon merged commit 1168ff8 into main Jul 1, 2026
42 checks passed
@peterzimon
peterzimon deleted the weyland-des-1418-clamp-post-preview-from-share-modal branch July 1, 2026 09:15
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.

3 participants