Skip to content

Conversation

@dHIM24
Copy link
Contributor

@dHIM24 dHIM24 commented Jan 29, 2026

  • Добавлен view skeleton для компонента SegmentedControl.

Чек лист

  • Задача сформулирована и описана в JIRA
  • В названии ветки есть айдишник задачи в JIRA (fix/DS-1234), ссылку прикреплять не надо
  • У реквеста осмысленное название feat(...) или fix(...) по conventional commits (https://www.conventionalcommits.org)
  • Код покрыт тестами и протестирован в различных браузерах
  • Добавленные пропсы добавлены в демки и описаны в документации
  • К реквесту добавлен changeset

Если есть визуальные изменения

  • Прикреплено изображение было/стало
Снимок экрана 2026-01-29 в 10 49 58

Код для песочницы:

render(() => {
    const [selectedId, setSelectedId] = React.useState({
        '1': 1,
        '2': 1,
        '3': 1,
        '4': 1,
    });
    const handleChange = (pos, id) => setSelectedId({ ...selectedId, [pos]: id });
    return (
        <div style={{ width: 360 }}>
        <Space fullWidth size={24}>
            <SegmentedControl size={40} onChange={(id) => handleChange('1', id)} selectedId={selectedId["1"]} skeleton={{visible: true}}>
                <Segment id={1} title='Таб 1' />
                <Segment id={2} title='Таб 2' />
            </SegmentedControl>
            <SegmentedControl onChange={(id) => handleChange('2', id)} selectedId={selectedId["2"]} skeleton={{visible: true}}>
                <Segment id={1} title='Таб 1' />
                <Segment id={2} title='Таб 2' />
            </SegmentedControl>
            <SegmentedControl size={40} shape='rounded' onChange={(id) => handleChange('3', id)} selectedId={selectedId["3"]} skeleton={{visible: true}}>
                <Segment id={1} title='Таб 1' />
                <Segment id={2} title='Таб 2' />
            </SegmentedControl>
            <SegmentedControl shape='rounded' onChange={(id) => handleChange('4', id)} selectedId={selectedId["4"]} skeleton={{visible: true}}>
                <Segment id={1} title='Таб 1' />
                <Segment id={2} title='Таб 2' />
            </SegmentedControl>
        </Space>
    </div>
    )
})

@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2026

🦋 Changeset detected

Latest commit: 3f2be4f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@alfalab/core-components-segmented-control Minor
@alfalab/core-components Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coveralls
Copy link

coveralls commented Jan 29, 2026

Pull Request Test Coverage Report for Build 21607372055

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 8 of 9 (88.89%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 79.864%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/segmented-control/src/Component.tsx 8 9 88.89%
Totals Coverage Status
Change from base Build 21288160713: 0.001%
Covered Lines: 9731
Relevant Lines: 11419

💛 - Coveralls

@dHIM24 dHIM24 requested a review from Oladii January 29, 2026 07:53
@dHIM24 dHIM24 marked this pull request as ready for review January 29, 2026 07:53
@github-actions
Copy link
Contributor

Demo build

https://core-ds.github.io/core-components/2028

* Показывает скелетон вместо контента
* @default false
*/
showSkeleton?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Обсудим потом вариант объеденения пропса?
Например

skeleton: {show: boolean, props: {}}


const skeletonBorderRadius = (() => {
if (shape === 'rounded') {
return sizeClassName === 'size-40' ? 20 : 16;
Copy link
Contributor

@fulcanellee fulcanellee Jan 29, 2026

Choose a reason for hiding this comment

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

тут и в остальных местах идет проверка на size-40. в принципе можно сразу вывести функцию:

size === 40 || size === 'xs'.

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.

5 participants