Skip to content

feat: revamp blog reading page ui and reading experience#338

Merged
amaan-bhati merged 7 commits into
keploy:mainfrom
dhananjay6561:blog-page-revamp
Mar 9, 2026
Merged

feat: revamp blog reading page ui and reading experience#338
amaan-bhati merged 7 commits into
keploy:mainfrom
dhananjay6561:blog-page-revamp

Conversation

@dhananjay6561

Copy link
Copy Markdown
Member

Blog Article Page — Complete UI/UX Revamp

Summary

Complete overhaul of the blog article page — new CSS Grid layout, two new components, revamped typography, author hover cards, portal-based TOC tooltips, and a Keploy-branded sidebar. Strokes over shadows throughout.

16 files changed · 1,499 insertions · 613 deletions


Changes

Layout

  • Replaced Flexbox with a 3-column CSS Grid (TOC | 780px Content | Sidebar) at ≥1440px; single column below
  • Unified content width to 780px across PostHeader, PostBody, mobile TOC, and AuthorCard
  • Reduced navbar-to-hero gap (-mt-16 md:-mt-20) in both slug pages
  • Responsive container padding: px-5 → sm:px-6 → lg:px-10 → xl:px-16 → 2xl:px-20

New Components

  • AuthorCard.tsx — Replaces old AuthorDescription + ReviewingAuthor. Clean card with colored accent bar (orange=Writer, purple=Reviewer), role badge, 80×80 avatar, 3-line description, "View All Posts →" CTA, optional LinkedIn link. No shadows, strokes only.
  • BlogSidebar.tsx — Right sidebar (max 260px): Share icons (X, Facebook, LinkedIn, copy-link), Category pill, Keploy CTA banner (#FFF4EE bg, #FF914D border).

PostHeaderAuthors (Rewritten)

  • Removed all social share icons (moved to sidebar)
  • Added tag pills below author row with hover states
  • Added author hover cards on name hover only (dashed underline hint) — compact w-60 card with role badge, avatar, description, "View Profile →" button
  • Mutual dismiss between Writer/Reviewer cards via shared refs; 0ms show, 60ms hide
  • Custom orange SVG icons for date and reading time
  • New date format: "7. June 2024"

Table of Contents (Rewritten)

  • Breakpoint changed to 1440px; sticky desktop card (max-w-[320px]), collapsible dropdown on smaller screens
  • Portal-based tooltip replacing native title — 50ms delay, border stroke, no shadow, no clipping
  • Minimal custom scrollbar (1px gray thumb, transparent track)

Typography & Styling

  • DM Sans (variable 400–900) as article font
  • Heading font-weight forced to 700 via DOM mutation (useEffect + style.setProperty) to override WordPress inline styles
  • Heading line-heights: h1=1.35, h2=1.4, h3=1.45, h4–h6=1.5
  • Post title: lineHeight: 1.25, fontWeight: 800, clamp() responsive sizing
  • Embedded links: no underline, orange color, inherited font-weight
  • Removed stale line-height: 1.1 !important global override from index.css

Slug Pages (technology + community)

  • Pass new props to PostBody: authorImageUrl, authorDescription, categories
  • Tags footer section commented out (tags now shown as pills in header)

Other

  • cover-image.tsx — rounded corners (rounded-xl)
  • categories.tsx — styling consistency update
  • testimonials.tsx — minor rendering fix
  • next.config.js — image domain config update

Files Modified

# File Type Summary
1 components/AuthorCard.tsx New Writer/Reviewer card with accent bar, role badge, avatar, CTA
2 components/BlogSidebar.tsx New Share icons, Category pill, Keploy CTA banner
3 components/PostHeaderAuthors.tsx Rewritten Tag pills, hover cards, mutual dismiss, custom SVG icons
4 components/TableContents.tsx Rewritten Portal tooltip, scrollbar, 1440px breakpoint, mobile dropdown
5 components/post-body.tsx Rewritten CSS Grid layout, DOM mutation, AuthorCard + BlogSidebar integration
6 components/post-body.module.css Modified Heading line-heights, link styles, font-weight 700
7 components/post-header.tsx Modified max-w-[780px], tags prop passthrough
8 components/post-title.tsx Modified lineHeight 1.25, fontWeight 800, clamp() sizing
9 components/cover-image.tsx Modified rounded-xl corners
10 components/categories.tsx Modified Styling update
11 components/containerSlug.tsx Modified Responsive padding scale
12 components/testimonials.tsx Modified Minor fix
13 styles/index.css Modified Removed line-height override
14 pages/technology/[slug].tsx Modified New props, gap reduction, tags commented out
15 pages/community/[slug].tsx Modified Same as technology slug
16 next.config.js Modified Image domain config

Screenshots

Desktop (≥ 1440px)

Before After
image image

Mobile (< 768px)

Before After
image image

Tablet (768px – 1439px)

Before After
image image

Dark Mode

Before After
image image

Build Output (npm run build)

image

Testing

  • npm run build passes
  • Desktop verified (1440px, 1920px, 2560px)
  • Tablet verified (768px, 1024px, 1280px)
  • Mobile verified (375px, 414px, 430px)
  • Hover cards — instant show, mutual dismiss, no overlap
  • TOC tooltip — no clipping, correct positioning
  • Share buttons and copy link work correctly
  • AuthorCard renders with correct role colors and fallback avatar
  • No console errors in development mode

Copilot AI review requested due to automatic review settings March 2, 2026 17:01
@dhananjay6561

Copy link
Copy Markdown
Member Author

Hi @amaan-bhati ,
Kindly review the PR

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Signed-off-by: dhananjay6561 <dhananjayaggarwal6561@gmail.com>
@dhananjay6561

Copy link
Copy Markdown
Member Author

Hi @amaan-bhati
made some minor changes as suggested and discussed.
Kindly review the PR

@amaan-bhati amaan-bhati requested a review from Copilot March 9, 2026 09:32
@amaan-bhati amaan-bhati changed the title Revamp: Blog Article Page -Complete UI/UX Revamp feat: revamp blog reading page ui and reading experience Mar 9, 2026
@amaan-bhati amaan-bhati self-requested a review March 9, 2026 09:38

@amaan-bhati amaan-bhati left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey @dhananjay6561 I tried reviewing the pr locally, most of the things look good to me, but there are a few things that i think needs to be updated/imporoved:

  • the tags need to be clickabble, clicking on each tag redirects to the blogs under that tag, you can check the current behaviour of tags on the prod, clicking on each tag redirects to the blogs under the tag.
Image
  • There seems to be an unwanted line behind the banner image of the blog, the line is tight behind the banner image in the header which i think might be unwanted here, please confirm if it was intended.
Image
  • please also confirm that the previous tags that were below the blog near the author and reviewer cards are not removed, they are just commented out.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 12 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread styles/index.css
Comment on lines 218 to +228
pre {
background-color: #222222 !important;
color: antiquewhite;
}

.footer-font{
font-family: "__Inter_aaf875","__Inter_Fallback_aaf875", sans-serif;
/* ── Blog-scoped styles (post-content-wrapper) ── */

.post-content-wrapper pre {
background-color: #1e1e2e;
color: #cdd6f4;
}

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

.post-content-wrapper pre is intended to restyle blog code blocks, but the global pre { background-color: ... !important; } rule above will override it, so the new colors won’t apply. Consider scoping/removing the global pre rule or removing the !important so the blog-scoped rule can take effect.

Copilot uses AI. Check for mistakes.
Comment on lines +193 to +218
let h2Count = 0;
let h3Count = 0;
let h4Count = 0;

return headings.map((item, index) => {
const sid = sanitizeStringForURL(item.id, true);
const isAct = sid === activeId;
const isH3Plus = item.type === "h3" || item.type === "h4";
const isH4 = item.type === "h4";

// Compute numbering
let number = "";
if (item.type === "h2" || item.type === "h1") {
h2Count++;
h3Count = 0;
h4Count = 0;
number = `${h2Count}.`;
} else if (item.type === "h3") {
h3Count++;
h4Count = 0;
number = `${h2Count}.${h3Count}`;
} else if (item.type === "h4") {
h4Count++;
number = `${h2Count}.${h3Count}.${h4Count}`;
}

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

The number variable is computed for TOC items but never rendered/used. This is dead code and makes the TOC harder to maintain; either display the numbering or remove the counters/number computation.

Suggested change
let h2Count = 0;
let h3Count = 0;
let h4Count = 0;
return headings.map((item, index) => {
const sid = sanitizeStringForURL(item.id, true);
const isAct = sid === activeId;
const isH3Plus = item.type === "h3" || item.type === "h4";
const isH4 = item.type === "h4";
// Compute numbering
let number = "";
if (item.type === "h2" || item.type === "h1") {
h2Count++;
h3Count = 0;
h4Count = 0;
number = `${h2Count}.`;
} else if (item.type === "h3") {
h3Count++;
h4Count = 0;
number = `${h2Count}.${h3Count}`;
} else if (item.type === "h4") {
h4Count++;
number = `${h2Count}.${h3Count}.${h4Count}`;
}
return headings.map((item, index) => {
const sid = sanitizeStringForURL(item.id, true);
const isAct = sid === activeId;
const isH3Plus = item.type === "h3" || item.type === "h4";
const isH4 = item.type === "h4";

Copilot uses AI. Check for mistakes.
Comment on lines 196 to 197
blogwriter[0].name.split(" ")[0].toLowerCase() ===
blogreviewer[0].name.toLowerCase();

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

sameAuthor comparison looks incorrect: it compares the writer’s first name to the reviewer’s full lowercased name, so it will almost always be false (even when they are the same person). Please compare like-with-like (e.g., compare full names, or compare first names for both).

Suggested change
blogwriter[0].name.split(" ")[0].toLowerCase() ===
blogreviewer[0].name.toLowerCase();
blogwriter[0].name.toLowerCase() === blogreviewer[0].name.toLowerCase();

Copilot uses AI. Check for mistakes.
Comment thread components/post-body.tsx
Comment on lines 21 to +36
export default function PostBody({
content,
authorName,
authorImageUrl,
authorDescription,
ReviewAuthorDetails,
slug
slug,
categories,
}: {
content: Post["content"];
authorName: Post["ppmaAuthorName"];
authorImageUrl: string;
authorDescription: string;
ReviewAuthorDetails: { edges: { node: { name: string; avatar: { url: string }; description: string } }[] };
slug: string | string[] | undefined;
categories?: Post["categories"];

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

The categories prop was added to PostBody but is never used in the component. Please remove it (and the corresponding props passed from the slug pages) or use it in the new sidebar/category UI.

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +23
font-weight: 400;
/* Keeping standard bold, not increasing it */

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

.content strong, .content b sets font-weight: 400, which removes the semantic emphasis that <strong>/<b> is expected to provide and can reduce readability/accessibility. Please use an actual bold weight (e.g., 600/700) or inherit the browser default bold styling.

Suggested change
font-weight: 400;
/* Keeping standard bold, not increasing it */
font-weight: 600;
/* Use a semi-bold weight to preserve emphasis and accessibility */

Copilot uses AI. Check for mistakes.
Comment thread styles/index.css
Comment on lines +250 to +255
.post-content-wrapper .relative {
border-radius: 0.5rem;
overflow: hidden;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
margin-bottom: 1.5rem;
}

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

.post-content-wrapper .relative is a very broad selector and will affect any element inside post content that uses the Tailwind relative class, making the styling fragile. It also adds a box-shadow even though the PR description calls out “strokes over shadows”; consider targeting a more specific wrapper/class and removing the shadow if that’s the intended design.

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +23
const [coords, setCoords] = useState({ top: 0, left: 0 });
const timeout = useRef<ReturnType<typeof setTimeout>>(null);
const wrapperRef = useRef<HTMLDivElement>(null);

const handleEnter = () => {
timeout.current = setTimeout(() => {
if (wrapperRef.current) {
const rect = wrapperRef.current.getBoundingClientRect();
setCoords({
top: rect.top + rect.height / 2,
left: rect.right + 12,
});
}
setShow(true);
}, 50);
};

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

timeout is initialized with null but the ref type doesn’t include null, which makes the code harder to reason about and will become an error if strictNullChecks is enabled later. Consider typing it as useRef<ReturnType<typeof setTimeout> | null>(null) and clearing any existing timeout before setting a new one to avoid multiple pending timers.

Copilot uses AI. Check for mistakes.
Comment thread components/AuthorCard.tsx
Comment on lines +58 to +64
/* Resolve avatar src (handle external URLs via proxy) */
const resolvedSrc =
!imageUrl || imageUrl === "n/a"
? "/blog/images/author.png"
: /^https?:\/\//i.test(imageUrl) && basePath
? `${basePath}/api/proxy-image?url=${encodeURIComponent(imageUrl)}`
: imageUrl;

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

resolvedSrc only proxies external images when basePath is passed in, but current callers (e.g., PostBody) don’t provide it. This can break author avatars for external hosts not in next.config.js image domains. Consider deriving basePath via useRouter() inside AuthorCard (as ReviewingAuthor does) so external images reliably go through /api/proxy-image when needed.

Copilot uses AI. Check for mistakes.
Comment thread components/post-body.tsx
Comment on lines +27 to 29
slug,
categories,
}: {

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

categories is accepted as a prop but doesn’t appear to be used anywhere in PostBody. Please remove it (and stop passing it from the slug pages) or wire it into the new sidebar/category UI so it isn’t dead API surface.

Copilot uses AI. Check for mistakes.
Comment thread components/post-body.tsx
Comment on lines 281 to +284
return (
<div key={index} className="relative mx-auto mb-4">
<div key={index} className="rounded-lg overflow-hidden mb-6 border border-[#313244] shadow-md">
{/* Header bar: language badge + copy button */}
<div className="flex items-center justify-between px-4 py-2 bg-[#181825] border-b border-[#313244]">

Copilot AI Mar 9, 2026

Copy link

Choose a reason for hiding this comment

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

The code-block wrapper adds shadow-md, but the PR description calls out “strokes over shadows throughout”. If the new design intent is truly no-shadows, consider removing the shadow here (and relying on border strokes only) for consistency.

Copilot uses AI. Check for mistakes.
Signed-off-by: dhananjay6561 <dhananjayaggarwal6561@gmail.com>
@dhananjay6561

Copy link
Copy Markdown
Member Author

Hi @amaan-bhati
I have made the required changes
Attaching the succesful build screenshot
image

@amaan-bhati amaan-bhati left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey @dhananjay6561 Thanks for following up on the previous review, I tried reviewing your changes again locally, the clickable tags thing is fixed, The line behind the banner i still pending which i think should be covered in an another pr as early as possible before the release. Please also try to resolve the remaining copilot comments from this pr. We'd hence raise one more pr resolving these changes before the release, you can raise the pr once you are done with the integration testing page pr you have in hand.

Merging this pr for now, checks:

  • UI is stable on desktop :
Image
  • UI is stable on smaller devices:
Image
  • Ran npm run build nothing breaks:
Image

@amaan-bhati amaan-bhati merged commit 84c5608 into keploy:main Mar 9, 2026
3 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.

3 participants