Skip to content

TT-7290,7216,6739,7244,7081 Enhance MediaRecord and CommentEditor components with audio draft management and scrollbar handling#336

Merged
gtryus merged 3 commits into
developfrom
TT-7290-hide-disc
May 29, 2026
Merged

TT-7290,7216,6739,7244,7081 Enhance MediaRecord and CommentEditor components with audio draft management and scrollbar handling#336
gtryus merged 3 commits into
developfrom
TT-7290-hide-disc

Conversation

@gtryus
Copy link
Copy Markdown
Contributor

@gtryus gtryus commented May 27, 2026

  • TT-7290 Added hideSegmentControls prop to MediaRecord for better UI control.
  • TT-7081 Implemented scrollbar width measurement and handling in usePaneWidth and DiscussionPanel to improve layout responsiveness.
  • Introduced onAudioDraftChange callback in CommentEditor to manage audio draft state.
  • Updated DiscussionCard to track audio draft status and integrate with CommentEditor.
  • Refactored DiscussionList to utilize new state management for changes and scrollbar adjustments.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the renderer discussion/audio-recording UX by (1) adding finer-grained control over MediaRecord’s UI, (2) tracking audio-draft state while composing comments, and (3) improving layout responsiveness by accounting for vertical scrollbar width when computing available panel widths.

Changes:

  • Added scrollbar-width measurement utilities and integrated them into usePaneWidth and DiscussionPanel for better width calculations when scrollbars appear.
  • Introduced audio-draft tracking from CommentEditor up to DiscussionCard to enable actions while an audio draft exists (even before upload/canSave fully propagates).
  • Added hideSegmentControls prop plumbing through MediaRecord (forwarded to WSAudioPlayer) and used it in CommentEditor’s compact recorder.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/renderer/src/utils/index.ts Re-exports the new scrollbar utility module from the utils barrel.
src/renderer/src/utils/getScrollbarWidth.ts Adds DOM helpers to measure scrollbar width and detect presence of vertical scrollbars.
src/renderer/src/components/usePaneWidth.ts Incorporates scrollbar width into pane-width calculations and returns it to callers.
src/renderer/src/components/MediaRecord.tsx Adds hideSegmentControls prop and forwards it to WSAudioPlayer.
src/renderer/src/components/Discussions/DiscussionPanel.tsx Adjusts panel width/margins using measured scrollbar width on desktop.
src/renderer/src/components/Discussions/DiscussionList.tsx Removes hard-coded scrollbar spacing, and switches close-button disabling to state-driven anyChanged.
src/renderer/src/components/Discussions/DiscussionCard.tsx Tracks hasAudioDraft and uses it to control save/add enablement; wires callback into CommentEditor.
src/renderer/src/components/Discussions/CommentEditor.tsx Adds onAudioDraftChange, refactors recorder/action button layout, and improves unsaved/draft tracking during recording.

Comment on lines +4 to +16
const outer = document.createElement('div');
outer.style.visibility = 'hidden';
outer.style.overflow = 'scroll';
// @ts-expect-error msOverflowStyle is IE-specific
outer.style.msOverflowStyle = 'scrollbar';
document.body.appendChild(outer);

const inner = document.createElement('div');
outer.appendChild(inner);

const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;
outer.parentNode?.removeChild(outer);
return scrollbarWidth;
Comment on lines +50 to +54
const [scrollbarWidth, setScrollbarWidth] = useState(0);
const cachedScrollbarWidthRef = useMemo(
() => (typeof document !== 'undefined' ? measureScrollbarWidth() : 0),
[]
);
Comment thread src/renderer/src/components/usePaneWidth.ts
@gtryus gtryus force-pushed the TT-7290-hide-disc branch from 3661f0a to 8460463 Compare May 27, 2026 22:11
@gtryus gtryus requested a review from sarahentzel May 28, 2026 21:07
Greg Trihus added 3 commits May 29, 2026 12:07
…ponents with audio draft management and scrollbar handling

- TT-7290 Added `hideSegmentControls` prop to `MediaRecord` for better UI control.
- TT-7081 Implemented scrollbar width measurement and handling in `usePaneWidth` and `DiscussionPanel` to improve layout responsiveness.
- Introduced `onAudioDraftChange` callback in `CommentEditor` to manage audio draft state.
- Updated `DiscussionCard` to track audio draft status and integrate with `CommentEditor`.
- Refactored `DiscussionList` to utilize new state management for changes and scrollbar adjustments.
…ndling for pending audio uploads. Introduced a ref for canSaveRecording to track its state and updated logic to wait for audio comment blob readiness before saving.
- to remove dynamic scrollbar width calculation and update state destructuring to include discussOpen
- recalculate measureScrollbarWidth
@gtryus gtryus force-pushed the TT-7290-hide-disc branch from 449b06b to 6ecd8b4 Compare May 29, 2026 17:07
@gtryus gtryus merged commit 077bc27 into develop May 29, 2026
2 checks passed
@gtryus gtryus deleted the TT-7290-hide-disc branch May 29, 2026 21:17
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