Skip to content

feat(channels): label All-feed posts with a topic chip - #218

Merged
iebb merged 1 commit into
iebb:masterfrom
TiaraBasori:feat/topic-chip-all-feed
Oct 16, 2026
Merged

iebb merged 1 commit into
iebb:masterfrom
TiaraBasori:feat/topic-chip-all-feed

Conversation

@TiaraBasori

@TiaraBasori TiaraBasori commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Change

In a topic chat's aggregated All feed (_selectedThreadId == null), posts from different topics rendered as an unmarked stream with no topic indicator.

This change renders a _TopicChip row above each _TopicPostRow in the aggregated feed (followed by a 10px vertical gap before the sender row):

  • Geometry & spacing: Padding(padding: EdgeInsets.symmetric(vertical: 2)) wrapping a Row(mainAxisSize: MainAxisSize.min) with a 20px square TopicIconSurface (custom emoji or tinted hashtag tile), a 6px horizontal gap, a Flexible single-line Text (fontSize: 14, fontWeight: FontWeight.w600, maxLines: 1, overflow: TextOverflow.ellipsis), and — when topic.isClosed is true — a 4px gap followed by a 12px AppIcon(HeroAppIcons.lock, color: c.textTertiary).
  • Color: final tint = topic.iconColor ?? AppTheme.avatarColor(topic.name) applied to both TopicIconSurface.tint and the label TextStyle.color.
  • Routing & scope: wrapped in a GestureDetector(key: ValueKey('topic-post-chip-${topic.id}'), behavior: HitTestBehavior.opaque, onTap: onOpen) wired to () => _selectTopic(post.topic.id). Shown only when _selectedThreadId == null; a topic-scoped feed omits the chip because the header already identifies the active topic.
  • Affected platforms: all platforms rendering TopicChatView (lib/channels/topic_chat_view.dart). No new l10n keys (displays the topic's own name).

Telegram API Terms classification

Follow the contribution and agentic review rules. Select exactly one classification and explain it below.

This is an agentic source-code review classification. Every store version must remain compliant with applicable Telegram API Terms; the guarded-source exception does not apply to store distribution or review.

  • Compliant/unchanged: this change complies with applicable Telegram API Terms, preserves Telegram's basic functionality, and does not introduce behavior covered by section 1.4.
  • Section 1.4 exception: the entire feature is guarded by allowTelegramTosViolations (I_DONT_FUCKING_CARE_ABOUT_TOS), disabled in official builds, and available only in an explicitly enabled self-build.
  • Disallowed or unresolved: this PR must not be approved or merged until its classification and implementation are resolved.

Reason and affected Telegram behavior: Presentation-only topic label in TopicChatView using the already-loaded _ForumTopic metadata and the existing _selectTopic navigation callback. Introduces no new TDLib requests, modifies no read/typing/online/retention behavior, and does not touch any section 1.4 surface.

Basic checks (every PR)

Check each item after verification. If a check is inapplicable, explain why in the evidence below before checking it.

  • I reviewed the diff for correctness, unintended behavior, secrets, and unrelated changes.
  • Formatting passed, or I recorded why it is inapplicable: dart format --output=none --set-exit-if-changed lib/channels/topic_chat_view.dart test/topic_post_topic_chip_test.dart (CI Dart SDK 3.12.2 / Flutter 3.44.2, Formatted 2 files (0 changed)).
  • Analysis passed, or I recorded why it is inapplicable: flutter analyze lib/channels/topic_chat_view.dart test/topic_post_topic_chip_test.dart (No issues found!).
  • Relevant tests passed, or I recorded why they are inapplicable; name the commands and test cases below. Quality CI runs flutter test --concurrency=4.
  • I checked affected build/platform paths and applicable localization/generated files; list the evidence below.
  • I completed the Terms classification above and verified that official builds cannot enable section 1.4 exceptions.

Commands, results, platform/build/UI evidence, and reasons for inapplicable checks:

  • ~/.cache/dart3122/bin/dart format --output=none --set-exit-if-changed lib/channels/topic_chat_view.dart test/topic_post_topic_chip_test.dart → Formatted 2 files (0 changed)
  • PATH=/tmp/flutter-3.44.2/bin:$PATH flutter analyze lib/channels/topic_chat_view.dart test/topic_post_topic_chip_test.dart → No issues found!
  • PATH=/tmp/flutter-3.44.2/bin:$PATH flutter test -j 1 test/topic_post_topic_chip_test.dart → 2/2 passed (the aggregated feed labels every post with its topic chip, a topic-scoped feed does not label its posts).
  • Failing-first verification: with showTopicChip: _selectedThreadId == null reverted in lib/channels/topic_chat_view.dart, the aggregated feed labels every post with its topic chip fails at expect(find.byKey(const ValueKey('topic-post-chip-1')), findsNWidgets(2)) (Actual: _KeyFinder:<Found 0 widgets>); a topic-scoped feed does not label its posts is a negative scope guard that passes in both states by design.
  • Localization & generated checks:
    • python3 tool/check_l10n_strings.py → No visible UI string literals outside lib/l10n.
    • python3 translations/tools/check.py → 8 locales x 3826 keys (11 counted): OK
    • python3 translations/tools/gen_assets.py --check → 9 locale assets are up to date
    • python3 tool/gen_registration_anchors.py --check → exit 0

Section 1.4 exception checks

Not applicable

Agentic reviewer confirmation

Agentic code reviewer only: record this confirmation in the PR review or check these boxes before approval.

  • I independently confirmed the Terms classification and inspected all required guards and evidence.
  • Applicable checks and Quality CI pass; no unresolved classification or unguarded section 1.4 behavior remains.

@iebb iebb left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed 9e82164 against master 066c2d6 in an isolated credential-free snapshot; both changed-file blobs match. The chip uses the existing topic model/icon and _selectTopic routing only in the aggregate feed; the scoped feed remains unlabelled. 22 focused topic-chip/navigation/parity tests pass, scoped formatting/analyzer and localization/generated/string/registration checks pass, and exact-head Quality CI is green. No new Telegram action or section 1.4 behavior was found.

Before approval/merge, complete .github/pull_request_template.md as required by AGENTS.md: select one Telegram API Terms classification with its explanation, complete the basic-check evidence/checklist, and mark exception checks not applicable for a compliant/unchanged presentation change. The current Problem/Fix/Tests text omits that mandatory declaration. Also describe concrete chip dimensions/spacing/color/routing rather than another client's style as the implementation contract.

Leaving this legitimate improvement open for the missing contribution evidence, not closing/rejecting it. Direct Git fetching is unavailable; no merge, commit, or push was made. The tests are Flutter UI fixtures, not physical-device QA.

The aggregated feed showed every post as an unmarked stream, so posts
from different topics were indistinguishable. Render a _TopicChip row
above each post when _selectedThreadId == null (with a 10px bottom gap
before the sender header):

- 20px TopicIconSurface (custom emoji or tinted hashtag tile) + 6px gap
  + single-line 14px w600 topic name in topic.iconColor ??
  AppTheme.avatarColor(topic.name) + optional 4px gap and 12px
  HeroAppIcons.lock (c.textTertiary) for closed topics, padded 2px
  vertically inside an opaque GestureDetector (topic-post-chip-<id>).
- Tapping routes through _selectTopic(post.topic.id).
- Topic-scoped feeds (_selectedThreadId != null) omit the chip because
  the header already names the topic.
@TiaraBasori
TiaraBasori force-pushed the feat/topic-chip-all-feed branch from 9e82164 to b8a3cd3 Compare October 16, 2026 11:14
@TiaraBasori TiaraBasori changed the title feat(channels): label All-feed posts with their iOS-style topic chip feat(channels): label All-feed posts with a topic chip Oct 16, 2026
@TiaraBasori

Copy link
Copy Markdown
Contributor Author

Updated in b8a3cd30:

  1. Completed .github/pull_request_template.md in the PR description with the Compliant/unchanged Telegram API Terms classification, explanation of affected behavior, basic check commands and outputs, and Not applicable under Section 1.4 exception checks.
  2. Concrete design specification: updated the PR title, description, commit message, and doc comments in lib/channels/topic_chat_view.dart to state the exact geometry, spacing, typography, color resolution (20px TopicIconSurface, 6px gap, 14px w600 single-line label tinted with topic.iconColor ?? AppTheme.avatarColor(topic.name), 4px gap + 12px HeroAppIcons.lock in c.textTertiary when closed, 2px vertical hit-target padding, 10px bottom gap before the sender row), and _selectTopic(post.topic.id) routing directly rather than referencing another client's style.

@iebb iebb left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Re-reviewed b8a3cd3 against current master f311e34. The earlier missing declaration and concrete-style specification are resolved. The chip adds only the existing topic metadata/icon and _selectTopic routing in the aggregate feed; scoped feeds remain unlabelled. All 28 focused chip/navigation/parity tests pass. Independently adding the new regression tests to unchanged master reproduces the missing-chip failure; the corrected integrated tree passes. Existing master fixes are preserved when integrating this older merge base.

Independently reviewed the actual production diff and affected entry points. The completed contribution template is present; classification is compliant/unchanged, with no Section 1.4 feature or required exception guard. No authentication, protocol/native, storage-schema, release/deployment, or official-build flag path changes. Credential-free snapshots use secrets_example.dart only. The combined intended master tree 6202d9cf8812ed9ca91a39422039a4cfbcee0102 passes all 3,449 unit/widget tests (one existing skip), formatting of 999 files with zero changes, full analysis, 8 locales x 3830 keys / 9 generated locale assets, visible-string and registration checks, and explicit false/true/invalid build-flag tests. Current exact-head Quality is green. Platform evidence here is shared Flutter layout/navigation/selection testing, not native-device QA; no Telegram, real account, deployment, or store action was used.

@iebb
iebb merged commit 685ab4a into iebb:master Oct 16, 2026
1 check 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.

2 participants