Skip to content

feat(stories): collapse the block when there is nothing to show - #222

Merged
Xyzcancer merged 1 commit into
masterfrom
DEV-T-370-collapse-empty-stories-block
Sep 3, 2026
Merged

feat(stories): collapse the block when there is nothing to show#222
Xyzcancer merged 1 commit into
masterfrom
DEV-T-370-collapse-empty-stories-block

Conversation

@Xyzcancer

@Xyzcancer Xyzcancer commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

DEV-T-370: a stories block switched off in the dashboard loaded empty and still took up its 135pt row.

  • StoriesView hides itself and reports a zero height when there is nothing to show. A failed load collapses the same way; a later load with stories brings the block back.
  • Additive API: hasStories, onStoriesCollapse, StoriesView.defaultHeight, StoriesWidget.onCollapse(_:). Nothing removed — minor bump.
  • Fixes an Index out of range crash the empty block exposed: the loaded list is handed to the collection view on the main queue and read with bounds checks.

Hosts that pin the height themselves keep control and react through onStoriesCollapse.

A block switched off in the dashboard loads without stories, and the widget
kept its 135pt row anyway — an empty gap on the host screen. It now hides
itself, reports a zero intrinsic height and activates a zero-height
constraint; a failed load collapses the same way instead of leaving the
placeholder row shimmering for good. A later load with stories brings it
back.

Hosts that pin the height with a required constraint or lay the block out by
frame keep control and react through the new `onStoriesCollapse` / `hasStories`;
the SwiftUI wrapper drops its own frame to zero and exposes `onCollapse`.

Also closes a crash the empty block exposed: the loaded list was assigned off
the main queue while the placeholder row still asked for 4 cells, so the
subscript trapped on a shorter or empty list.
@Xyzcancer
Xyzcancer merged commit 929b8e3 into master Sep 3, 2026
2 checks passed
@Xyzcancer
Xyzcancer deleted the DEV-T-370-collapse-empty-stories-block branch September 3, 2026 08:07
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.

1 participant