Repository navigation
feat(hogs): bump @posthog/brand to 0.17.5 and add HoggieImage - #22638
rafaeelaudibert wants to merge 1 commit into
Conversation
Deploy preview
|
|
Vale prose linter → found 2 errors, 21 warnings, 0 suggestions in your markdown Full report → Copy the linter results into an LLM to batch-fix issues. Linter being weird? Update the rules!
|
| Line | Severity | Message | Rule |
|---|---|---|---|
| 3:9 | warning | 'hoggie' is a possible misspelling. | PostHogBase.Spelling |
| 3:59 | warning | 'hoggie' is a possible misspelling. | PostHogBase.Spelling |
| 5:14 | warning | 'hoggie' is a possible misspelling. | PostHogBase.Spelling |
| 5:32 | warning | 'Cloudinary' is a possible misspelling. | PostHogBase.Spelling |
| 23:53 | warning | 'hoggies' is a possible misspelling. | PostHogBase.Spelling |
| 23:93 | warning | 'hoggie' is a possible misspelling. | PostHogBase.Spelling |
| 25:36 | warning | 'hoggie' is a possible misspelling. | PostHogBase.Spelling |
| 41:81 | warning | 'hoggie' is a possible misspelling. | PostHogBase.Spelling |
| 41:131 | warning | 'hoggie' is a possible misspelling. | PostHogBase.Spelling |
| 49:7 | warning | 'hoggies' is a possible misspelling. | PostHogBase.Spelling |
| 49:38 | warning | 'px' is a possible misspelling. | PostHogBase.Spelling |
| 51:14 | warning | 'Cloudinary' is a possible misspelling. | PostHogBase.Spelling |
| 51:34 | warning | 'hoggies' is a possible misspelling. | PostHogBase.Spelling |
| 53:17 | warning | 'Cloudinary' is a possible misspelling. | PostHogBase.Spelling |
| 53:53 | warning | 'hoggie' is a possible misspelling. | PostHogBase.Spelling |
src/components/Hogpedia/README.md — 2 errors, 6 warnings, 0 suggestions
| Line | Severity | Message | Rule |
|---|---|---|---|
| 21:4 | warning | 'Where the Main Page gets its content' heading should be in sentence case, and product names should be capitalized. | PostHogBase.SentenceCase |
| 33:207 | warning | 'taskbar's' is a possible misspelling. | PostHogBase.Spelling |
| 74:175 | warning | Use 'IDs' instead of 'ids'. | Vale.Terms |
| 83:261 | warning | 'inlines' is a possible misspelling. | PostHogBase.Spelling |
| 85:195 | warning | 'inlined' is a possible misspelling. | PostHogBase.Spelling |
| 87:3 | warning | Use American English. Use 'center' instead of 'Centre'. | PostHogBase.AmericanEnglish |
| 91:190 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
| 91:654 | error | Hi, Andy here... use an en dash ( – ) with spaces. On Mac, holding down the Option and hyphen key will give you an en dash. | PostHogBase.EnDash |
Bundle reportTotal JS (gzip)12.22 MiB (+1.0 KiB / +0.0%) Largest changed named chunks
Eager graph (modules shipped in each entrypoint's initial chunks)
Largest modules in the
|
| Module | Size |
|---|---|
css ./node_modules/.pnpm/css-loader@5.2.7_webpack@5.101.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[1]!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.5.6_webpack@5.101.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[2]!./src/styles/global.css |
1023.8 KiB |
./src/components/Stickers/Stickers.tsx |
696.4 KiB |
./node_modules/.pnpm/@posthog+brand@0.17.5_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/puzzle.mjs |
388.2 KiB |
./node_modules/.pnpm/@posthog+icons@0.36.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
354.8 KiB |
./node_modules/.pnpm/react-markdown@8.0.7_@types+react@16.14.66_react@18.3.1/node_modules/react-markdown/lib/react-markdown.js + 88 modules |
351.4 KiB |
./node_modules/.pnpm/@posthog+brand@0.17.5_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/basketball-coach.mjs |
337.3 KiB |
./node_modules/.pnpm/framer-motion@14.0.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs + 126 modules |
287.2 KiB |
./node_modules/.pnpm/cloudinary-core@2.14.0_lodash@4.17.21/node_modules/cloudinary-core/cloudinary-core.js |
281.9 KiB |
./src/components/SearchUI/index.tsx + 87 modules |
273.1 KiB |
./gatsby-browser.tsx + 60 modules |
259.6 KiB |
./node_modules/.pnpm/@posthog+brand@0.17.5_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/construction-1.mjs |
248.7 KiB |
./src/components/Pricing/PricingSlider/Slider.tsx + 87 modules |
240.2 KiB |
./node_modules/.pnpm/@posthog+brand@0.17.5_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/construction-2.mjs |
228.0 KiB |
./node_modules/.pnpm/@posthog+brand@0.17.5_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/magnifying-glass.mjs |
221.9 KiB |
./src/hooks/useProduct.ts + 18 modules |
165.0 KiB |
Eager-graph budgets are report-only until a baseline is established. Sizes are gzip of public/**/*.js; eager size is webpack module source bytes for the modules actually shipped in the entrypoint's initial chunks (post-tree-shake).
3fe5eff to
3956d3e
Compare
9e8ad29 to
c0b2398
Compare
There was a problem hiding this comment.
PostHog Review · Standard · reviewed c0b2398: 2 Should fix.
This is the last automatic review of this pull request. Comment @posthog review to review new changes.
See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.
| width: `${(HOGGIE_SIZE / width) * 100}%`, | ||
| left: `${(-left / width) * 100}%`, | ||
| top: `${(-y / height) * 100}%`, |
There was a problem hiding this comment.
P2 · Account for non-square hoggies when calculating crops
When crop receives mailbox.png or burning-money.png, their actual 910×1000 dimensions invalidate the square-image assumption. Setting the image width from HOGGIE_SIZE enlarges both axes incorrectly, so crop coordinates select the wrong region and mirrored crops shift horizontally. Calculate scaling and mirrored offsets from the source dimensions.
| <Avatar | ||
| className={` ${isInForum ? 'size-8' : 'w-[25px] h-[25px]'} rounded-full`} | ||
| image="https://res.cloudinary.com/dmukukwp6/image/upload/v1688579513/thumbnail_max_c5dd553db8.png" | ||
| image={hogProfile} |
There was a problem hiding this comment.
P2 · Provide rendered screenshots for the avatar replacements
When MaxReply renders, the replacement appears inside Avatar with borders and a logo overlay; comparing standalone PNGs does not verify that composition or the other changed consumers. AGENTS.md:35 explicitly blocks visual changes without rendered before/after evidence. Capture affected areas at narrow and wide sizes in both themes.
c0b2398 to
331335d
Compare
Adds the `hoggies` webpack alias for the brand PNGs, a HoggieImage component that shows a hoggie with an optional mirror and crop, and the hog-profile avatar. CloudinaryImage only exports its isCloudinaryImage check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
331335d to
bd2a7a6
Compare
This is PR 1 of 4 in a stack. The stack replaces the old hedgehog images on posthog.com with hoggies from
@posthog/brand. Each PR is based on the PR before it. Review them in this order:/aifrom the brand art.Summary
This PR does four things:
@posthog/brandfrom 0.13.0 to 0.17.5. Version 0.17.5 adds thefinger-gunshoggie, which feat(hogs): replace old hedgehog images with brand hoggies #22640 uses. I compared the two versions: 0.17.5 only adds files and exports. It removes none.hoggies. Code imports a hoggie PNG withimport hedgehogStopPng from 'hoggies/stop.png', and webpack bundles the file.HoggieImagecomponent. It shows a hoggie PNG, and it can mirror or crop the hoggie in CSS. The site does not need extra image files for a mirrored or cropped hoggie.src/images/hog-profile.png, replaces three old images. It is the brand "sitting" hoggie, cut to a bust on a round background.We use the PNG files, not the brand SVG components. Each SVG component adds approximately 150 KB of gzipped JavaScript to the page. A PNG file is approximately 49 KB, and the browser loads it as an image.
This PR has no visible change except the avatar. The other PRs in the stack use the alias and
HoggieImage.🗺️ PR tour
Stop 1: The package update (diff, lockfile diff)
@posthog/brandchanges from 0.13.0 to 0.17.5.posthog.com/package.json
Line 87 in bd2a7a6
pnpm-lock.yamlby hand.pnpm addfails on the repo trust policy (no-downgrade) for other locked packages that this change does not touch. I copied the version and the integrity hash frompnpm view @posthog/brand@0.17.5, then ranpnpm install --frozen-lockfile, which passed.Stop 2: The
hoggiesalias (diff)The alias points to the PNG folder in the brand package.
posthog.com/gatsby-node.ts
Lines 107 to 119 in bd2a7a6
The package also has its own
@posthog/brand/hoggies/png/*modules. Those modules usenew URL('./x.png', import.meta.url), which the Gatsby 4 webpack rules do not resolve to a file URL. The alias gives a direct path to each PNG file, so Gatsby's normal image loader handles it.Stop 3:
HoggieImage(diff, README)The component shows a hoggie PNG. It has no state and no effects. It renders a
<span>(the box) that holds an<img>, the same layout asCloudinaryImage, so a component can render either one with the same classes. It uses a<span>, not a<div>, so it is valid inside a link or a paragraph.classNamestyles the box. Size, position, margin, and float classes go here.imgClassNamestyles the<img>.mirrorflips the hoggie with-scale-x-100.crop={[x, y, width, height]}shows only one box of the art, in the units of the 1000×1000 PNG, measured before the mirror.altdefaults to'', because most hoggies are decorative.<img>props (loading,title,width) go to the<img>.posthog.com/src/components/HoggieImage/index.tsx
Lines 19 to 31 in bd2a7a6
The props type does not allow
imgClassNametogether withcrop. With a crop, the box is the visible image, so its classes go onclassName:posthog.com/src/components/HoggieImage/index.tsx
Lines 56 to 74 in bd2a7a6
The box is an
overflow-hiddenwindow with the aspect ratio of the crop. The<img>inside is larger than the window, and negative margins move it so that the crop fills the window. A margin in percent is a percent of the box width, also formargin-top, so one formula works for both axes. The<img>stays in the flow, so the box needs nopositionclass, and a caller can make the boxabsolute. The crop'swidth,margin-left, andmargin-topcome after the caller'sstyle, so a caller cannot move the crop by accident.Each brand PNG has empty space around the art, and most old images had none. To show a hoggie at the size of the old image, #22640 crops it to the box around its art. The README has the command that prints that box.
burning-money,mailbox,workmaxxing), so a crop of them would be wrong. None of them is cropped. The code and the README say not to crop them. To support them, the component must know each image's width, which needs a measurement after load or a lookup table. That is more code for three images that nobody crops.The README explains the props, the layout, and how to render data that mixes Cloudinary URLs and hoggie PNGs.
Stop 4:
CloudinaryImage(diff)The only change is an
exporton the existingisCloudinaryImagecheck.posthog.com/src/components/CloudinaryImage/index.tsx
Lines 4 to 7 in bd2a7a6
#22640 uses it in components that get both kinds of URL. For example, some product pages still have a Cloudinary hog and others now have a hoggie. Those components use
isCloudinaryImageto selectCloudinaryImageorHoggieImage.CloudinaryImageitself does not know about hoggies.Stop 5: The new avatar (image, script)
src/images/hog-profile.pngreplaces three images:hog-9.png: the avatar for a team member who has no photo.thumbnail_max.png: the PostHog AI avatar on forum replies.max.png: the PostHog AI avatar in the docs chat. This is the same picture asthumbnail_max.png.scripts/hog-images/make-hog-profile.shmakes the file from the brand "sitting" hoggie with ImageMagick. It has the same format ashog-9.png: round, with transparent corners, at 400×400.The file is in the repo and webpack bundles it. It is not on Cloudinary, because Cloudinary does not copy new files from the repo.
Stop 6: The avatar call sites
Each site imports
hog-profile.pngin place of the old Cloudinary URL:TeamMember(diff): three fallbacks for a team member with no photo.Academy/PostQuote(diff),Careers/MegaQuote(diff),Careers/TeamQuotes(diff),Products/Slides/VideosSlide(diff): the same fallback in quotes and video credits.Squeak/components/Question(diff): the PostHog AI avatar on forum replies.useInkeepSettings(diff): the PostHog AI avatar in the docs chat.posthog.com/src/components/TeamMember/index.tsx
Line 110 in bd2a7a6
<img>, notCloudinaryImageorHoggieImage. Onmaster,CloudinaryImagedropsclassNamefor a URL that is not on Cloudinary.hog-profile.pngis not a brand hoggie, soHoggieImagedoes not apply. Where the old code put a size on the wrapper, the new code moves that class to the<img>or keeps the wrapper<div>(inVideosSlide).Stop 7: Docs (diff)
A note in the Hogpedia README said that PNG imports need a webpack rule first. It now points to the
hoggiesalias.🔍 Reviewer's guide
Testing done
pnpm install --frozen-lockfilewith the hand-edited lockfilenode_modules/@posthog/brandis 0.17.5exportsof the 0.17.3 and 0.17.5 tarballscello,finger-guns,maestro,make-it-rain,pepe-silvia-1,pepe-silvia-2)prettier --checkon the changed fileseslinton the changed filestscwith a temporary config that includes the changed filesHoggieImagepropstscon a test file with each prop combinationundefined. RejectscropwithimgClassNamepnpm start, loaded the pages of the full stackNot tested:
hog-9.pngshows only for a team member with no photo, and no page shows one today. The PostHog AI avatar on forum replies shows only while PostHog AI answers a question that a person just posted, and the docs chat avatar shows only after a person asks the docs AI a question. To capture them, I must post to the real forum or send a question to the real docs AI. The comparison below shows the old images and the new image.Screenshots
The avatar is the only visible change in this PR. The PNG is the same in light and dark mode, and its size comes from the call site, so the window width does not change it.
hog-9.pngthumbnail_max.pngandmax.pnghog-profile.pngWhat to look at
hoggiesalias points into the package'sdist/generatedfolder. That path is not part of the package's publicexports. If a later brand version moves the folder, every hoggie import in the stack fails at build time. The package's ownpng/*exports do not work with the Gatsby 4 webpack rules, so this was the most direct option. A brand version update must check this path.HoggieImage. A mistake here moves or clips every cropped hoggie in feat(hogs): replace old hedgehog images with brand hoggies #22640 (for example/services,/self-driving,/ai,/mcp, and the product page heroes). A mirrored crop starts from the other side of the art, because the image flips around its own center.pnpm install --frozen-lockfilechecks it, and it passed.🤖 Generated with Claude Code