Repository navigation
docs: tidy code comments and doc comments in src - #3332
Conversation
Rewrite comments and doc comments in present tense and keep only the non-obvious (invariants, ordering, defaults, reasons). Remove history, review and PR IDs, stage labels, banners and restatements, and fix comments that no longer matched the code. Comment-only: no code, string or directive changes. Verified by compiling every changed file with comments removed and comparing the output with master, plus an identical-lines check on non-comment, TODO and FIXME lines.
|
Important Review skippedToo many files! This PR contains 545 files, which is 395 over the limit of 150. To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. βοΈ Run configuration
π Files selected for processing: 545
You can disable this status message by setting the
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Size Change: -38.5 kB (-4.33%) Total Size: 849 kB π¦ View Changed
βΉοΈ View Unchanged
|
Codecov Reportβ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3332 +/- ##
==========================================
- Coverage 87.02% 87.02% -0.01%
==========================================
Files 547 547
Lines 16251 16251
Branches 5097 5097
==========================================
- Hits 14143 14142 -1
- Misses 2108 2109 +1 β View full report in Codecov by Harness. π New features to boost your workflow:
|
### Goal Fix the code issues noticed while tidying comments in #3332. Each item was checked against the code (and against `stream-chat` 10.0.0-rc.22 where it depends on LLC behavior) before changing anything. Stacked on #3332: its branch is the base, so merge that first. ### Implementation details Three commits, kept apart so they can be reviewed separately: **fix: correct logic bugs** (each with a regression test that fails without the fix) - `getLastReceived` never checked the first message (`i > 0`). - WAV encoding wrote audio with three or more channels at misaligned offsets. The internal `encodeToWaw` is renamed to `encodeToWav` (not exported from any entry point). - `NumericInput`: stepping an empty field with no `min` emitted `"-Infinity"`; it now steps to `min`, or 0. - `.xlsb` mapped to the `.xlam` MIME type, so it got the fallback icon. - `MessageRepliesCountButton` with only `labelSingle` rendered "1 <label>" for any count. - `InfiniteScroll` / `InfiniteScrollPaginator` never removed the `wheel` listener when `useCapture` was true. The existing test pinned the wrong removal and is updated. - `useStateStore` returned the stale cached selection when the selection gained a key or an array selection grew with the same prefix. Otherwise unchanged; seven new tests cover the cache. - `createTextComposerEmojiMiddleware` mutated its module-level defaults, leaking one call's options into later calls. - Replacing a channel released every thread bound as a slot base, including threads of other channels. With a known replaced channel only its own threads (matched by `cid`) are released; without one the behavior is unchanged. - `DownloadButton` rendered a link to `about:blank` for an unsafe URL; it now renders nothing. - The poll creation dialog called `send()` even when `createPoll()` returned without a poll, which would send drafted text instead. - `NotificationList` immediately swapped in an older notification of the same type (with a LIFO queue), skipping the dwell window. - `useLatestMessagePreview` cast any message status to a delivery status (e.g. `received` leaked into the public `deliveryStatus`). - A nested `WithDragAndDropUpload` dropped its `style`. **refactor: remove dead internal code**: the unused `CardAudio` component and `useThreadState` hook, `mock-builders` helpers for contexts removed in v15, unreachable branches, an unused internal parameter, a mid-file import. The skipped snap-back spec in `MessageList.test.tsx` passes (and fails with its guard disabled), so it is re-enabled. Public API is untouched; everything removed is internal per `scripts/api-surface.mts`. **chore: reword stale text**: `handleActionWarning` / `reactionHandlerWarning` no longer mention the removed ChannelAction/ChannelState contexts, test names drop history wording and ticket IDs, and `{@link}` targets that do not resolve become code spans. No `t()` copy changed. Not changed here, open for a decision: jump-to-latest from older history does not scroll (the v10 paginator suppresses the focus signal by default and autoscroll skips the merge into the head), the missing `str-chat__message-text-inner` class, `Callout` putting `className` on its close button, the `Slot` base remounting on the first and last layer, unused public props (`getErrorNotification`, `acceptedFiles`, `activeChannel`, `overflowCount`, `MessageReactions.reverse`) and `AudioPlayerState.playbackError` never being written. Checks: `yarn lint`, `tsc -p tsconfig.lib.json --noEmit`, `yarn validate-translations` and `yarn test` (287 files, 3126 tests) pass. `yarn types:tests` goes from 1004 to 1000 errors, none on changed lines. ### UI Changes No visual changes. Behavior changes are limited to the fixes above. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added support for Excel binary workbook (XLSB) file icons. * Numeric steppers now provide sensible values when starting from an empty field. * Drag-and-drop upload areas preserve custom styling. * Improved message mentions and email link formatting. * **Bug Fixes** * Unsafe attachment URLs are no longer rendered as download links. * Corrected multi-channel WAV recording and audio conversion. * Prevented accidental text delivery when poll creation fails. * Improved notification ordering, thread navigation, unread-message handling, and reply counts. * Fixed scroll and wheel-event cleanup after list unmounting. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
π This PR is included in version 15.0.0-rc.3 π The release is available on: Your semantic-release bot π¦π |
|
π This PR is included in version 15.0.0 π The release is available on: Your semantic-release bot π¦π |
Goal
Make the comments and doc comments in
srcaccurate and short. Many described removed APIs, merge history, review and PR IDs or stage labels, restated names and signatures, or no longer matched the code.Implementation details
This is a comment-only change across 545 files (+4,143 / -6,729 lines; comment lines went from 8,701 to 6,116, tests and
mock-buildersincluded). Generated files (src/i18n/keys.ts,src/styling/light.scss,src/styling/dark.scss), SCSS and the.mdfiles undersrcare not touched.Rules applied: present tense only; keep invariants, ordering and timing constraints, units, defaults, side effects and one-clause reasons; delete history, IDs, banners and restatements; no em-dashes;
IDin prose; "Defaults to X."; comments wrapped at 100 columns or less. Public API docs keep their tags (the only tag-count drop is@returnrenamed to@returnsinprocessMessages); a few exported functions whose docs had no tags gained@paramand@returns. Stacked or misplaced doc blocks were moved onto the declaration they describe, and//comments directly above exported declarations became JSDoc.How it was verified as comment-only: for every changed file, the base and working versions were compiled with comments removed (TypeScript transpile, or a comment-less print for
.d.ts) and the output is identical; non-comment lines (trailing whitespace included),TODO/FIXMElines and the counts of@deprecated,@internal,@ts-*,eslint-*and@exampleare identical tomaster. The guard was checked with negative controls (a changed token, string, trailing space,TODOor removed@deprecatedis flagged).git diff --check,prettierandeslint --max-warnings 0are clean.tsc -p tsconfig.lib.json --noEmitandvitestgive the same results as onmaster(the CI install is required for a green run).Each file was rewritten by one agent and then re-reviewed by a second, independent one that re-checked the claims against the code; comments that were wrong are fixed (the per-chunk findings are in the agents' reports).
What reviewers should look for: comments that are still wrong, a "why" that should have stayed (several reasons were dropped to one clause), and claims about
stream-chatv10 behavior, which could not be checked against an installed v10 and were kept as originally written or trimmed.UI Changes
None.