Skip to content

fix: improvements in editor exprience#2892

Merged
ahtesham-quraish merged 2 commits intomainfrom
ahtesham/improvements
Jan 30, 2026
Merged

fix: improvements in editor exprience#2892
ahtesham-quraish merged 2 commits intomainfrom
ahtesham/improvements

Conversation

@ahtesham-quraish
Copy link
Copy Markdown
Contributor

@ahtesham-quraish ahtesham-quraish commented Jan 26, 2026

What are the relevant tickets?

Description (What does it do?)

Following Improvements we have done in this PR

  • Pagination margin from bottom has been decreased
  • If image is not loaded because of any reason then we need to display placeholder instead broken image ui
  • The header part where breadcrum is visible should not have padding bottom other than first page.
  • If we have links in summary then it should be visible properly instead of text.

Screenshots (if appropriate):

image image image image

How can this be tested?

  • For image placeholder testing you just need to provide url for the image which is not valid one you can provide random string instead of valid url in react compoenent
    2 - On page 2, 3 and so on you should not see the extra bottom padding in banner image.
    3 - If you add the url to text by using the editor control or even paste the direct url in the sub-heading sectionwhile creating or updating the article then it should be properly render inside the listing page summary section of each News

Additional Context

Comment thread frontends/main/src/common/utils.ts Outdated
@@ -23,14 +23,20 @@ const collapseWhitespace = (text: string): string => {
const linkifyText = (text: string): string => {
if (!text) return ""
console.log("Linkifying text:", text)
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.

Can we remove the console.log

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

removed

<MainStoryCard>
<MainStoryImage>
{item.image?.url && (
{item.image?.url && !imageError && (
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.

Perhaps use a placeholder here, if the image errors.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It automatically shows the placeholder when we get error

const ArticleBannerStyled = styled(ArticleBanner)<{ $page: number }>`
padding: 48px 0;
padding-bottom: 250px;
${({ $page }) => $page === 1 && "padding-bottom: 250px;"}
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.

We don't tend to use $ prefixes for variable names and props in the codebase. Note that the $ prefix to mark a prop as transient is a styled-components thing, but Emotion does not support.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok

padding: 48px 0;
padding-bottom: 250px;
${({ $page }) => $page === 1 && "padding-bottom: 250px;"}
position: relative;
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.

Note that we object styles are preferred over template literals for type safety, ease of refactoring etc, also there was a plan to migrate to styled() or Pigment CSS for zero runtime / performance, which may resurface, see https://github.com/mitodl/hq/issues/6636.

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.

e.g. L435 cleaner with

    paddingBottom: page === 1 ? "250px" : undefined,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok

@@ -497,6 +499,8 @@ const MainStory: React.FC<{ item: NewsFeedItem }> = ({ item }) => {

// Regular Story Component for grid
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.

Let's add comments only if the code does not self describe.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok

@@ -23,14 +23,20 @@ const collapseWhitespace = (text: string): string => {
const linkifyText = (text: string): string => {
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.

Do we still need linkifyText() if links are now produced on the backend?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes it is still needed because if user directly paste the url in summary then it would have to add achor tag in summary text.

@ahtesham-quraish ahtesham-quraish added the Needs Review An open Pull Request that is ready for review label Jan 29, 2026
Copy link
Copy Markdown
Contributor

@jonkafton jonkafton left a comment

Choose a reason for hiding this comment

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

👍

@jonkafton jonkafton removed the Needs Review An open Pull Request that is ready for review label Jan 30, 2026
@ahtesham-quraish ahtesham-quraish merged commit f3ca00a into main Jan 30, 2026
13 checks passed
@ahtesham-quraish ahtesham-quraish deleted the ahtesham/improvements branch January 30, 2026 14:24
This was referenced Feb 2, 2026
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