Skip to content

[OSS::Stats::Banner] Add a new title nameblock & handle overflow on value - #703

Merged
aprentout merged 2 commits into
masterfrom
ap/pyx-486
Sep 14, 2026
Merged

aprentout merged 2 commits into
masterfrom
ap/pyx-486

Conversation

@aprentout

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Add a new title nameblock
  • handle overflow on value

Related to: #

What are the observable changes?

Enregistrement.de.l.ecran.2026-09-11.a.15.22.37.mov

Good PR checklist

  • Title makes sense
  • Is against the correct branch
  • Only addresses one issue
  • Properly assigned
  • Added/updated tests
  • Added/updated documentation with Figma design link. Don't forget to replace "design" by "file" in the URL. For example https://www.figma.com/file/example
  • Migrated touched components to Glimmer Components
  • Properly labeled

@linear-code

linear-code Bot commented Sep 11, 2026

Copy link
Copy Markdown

PYX-486

<div
class="oss-stats-banner"
data-control-name="oss-stats-banner"
{{did-insert (fn this.ensureBlockPresence (has-block "title"))}}

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.

smart 🤓

Comment thread tests/integration/components/o-s-s/stats/banner-test.ts Outdated
Comment on lines 30 to +57
{{else}}
<div class="oss-stats-banner__title-row" data-control-name="stats-banner-title-row">
<span
class="oss-stats-banner__title text-ellipsis font-color-gray-600 font-weight-semibold"
{{enable-tooltip title=@titleConfig.text placement="top" displayOnlyOnOverflow=true}}
>
{{@titleConfig.text}}
</span>
{{#if (has-block "title")}}
{{yield to="title"}}
{{else}}
<div class="oss-stats-banner__title-row" data-control-name="stats-banner-title-row">
<span
class="oss-stats-banner__title text-ellipsis font-color-gray-600 font-weight-semibold"
{{enable-tooltip title=@titleConfig.text placement="top" displayOnlyOnOverflow=true}}
>
{{@titleConfig.text}}
</span>

<div class="oss-stats-banner__title-actions" data-control-name="stats-banner-title-actions">
{{#if @titleConfig.infoCircle}}
<span
data-control-name="stats-banner-title-info-circle"
{{enable-tooltip title=@titleConfig.infoCircle placement="top"}}
>
<OSS::Icon @icon="fa-info-circle" class="font-color-gray-400" />
</span>
{{/if}}
<div class="oss-stats-banner__title-actions" data-control-name="stats-banner-title-actions">
{{#if @titleConfig.infoCircle}}
<span
data-control-name="stats-banner-title-info-circle"
{{enable-tooltip title=@titleConfig.infoCircle placement="top"}}
>
<OSS::Icon @icon="fa-info-circle" class="font-color-gray-400" />
</span>
{{/if}}

{{#if (has-block "title-suffix")}}
{{yield to="title-suffix"}}
{{/if}}
{{#if (has-block "title-suffix")}}
{{yield to="title-suffix"}}
{{/if}}
</div>
</div>
</div>
{{/if}}

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.

question: I'm not entire sure I follow the logic here. Above we want to ensure the presence of the title block and here render it OR a default component. This seems odd to me. I think I'm missing something. Could you explain, please?

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.

The goal is to allow user the ability to override the whole stats-banner-title-row if a <:title> nameblock is passed.

The use case I've with this is to be able to make the whole title section clickable for example which was not possible with the previous implementation

Enregistrement.de.l.ecran.2026-09-14.a.11.10.42.mov

Comment on lines 1 to 10
import { assert } from '@ember/debug';
import { action } from '@ember/object';
import Component from '@glimmer/component';

import type IntlService from 'ember-intl/services/intl';
import type { OSSTagArgs } from '@upfluence/oss-components/components/o-s-s/tag';

import type { OSSBadgeArgs } from '@upfluence/oss-components/components/o-s-s/badge';
import type { OSSIconArgs } from '@upfluence/oss-components/components/o-s-s/icon';
import type { OSSTagArgs } from '@upfluence/oss-components/components/o-s-s/tag';

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.

question: Hasn't prettier already been run on this repo? Why the new lines?

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.

Looks like prettier has not been run yet on oss, .prettierrc.js and .prettierignore file still exists

}

&__stat-value {
width: 100%;

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.

question: width or max-width?

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.

This one is applied on @container (width <= 200px)
In this case the flex direction switch from row to column so width and max-width would have the same behavior and this won't impact the wrap/overflow

Comment thread app/styles/organisms/stats-banner.less
@aprentout
aprentout merged commit 183cd97 into master Sep 14, 2026
5 checks passed
@aprentout
aprentout deleted the ap/pyx-486 branch September 14, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants