Skip to content

TT-7521 no offline sheet change#430

Merged
gtryus merged 2 commits into
developfrom
feature/TT-7521-no-offline-sheet-change
Jul 15, 2026
Merged

TT-7521 no offline sheet change#430
gtryus merged 2 commits into
developfrom
feature/TT-7521-no-offline-sheet-change

Conversation

@gtryus

@gtryus gtryus commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

This PR introduces a separate canEditAudio permission that remains available offline, while restricting structural sheet edits (canEditSheet) when the user is offline and not in offline-only mode.

The key insight (ref TT-7521): structural edits (add/move sections & passages) require server connectivity, but audio upload/delete can safely queue for later sync. Previously both used canEditSheet, so going offline blocked audio operations unnecessarily.

@gtryus gtryus changed the title Feature/TT 7521 no offline sheet change TT-7521 no offline sheet change Jul 15, 2026
@gtryus
gtryus requested a review from Copilot July 15, 2026 16:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 aims to split edit permissions in the renderer so that structural sheet edits (sections/passages) are restricted when offline (unless in offline-only mode), while audio upload/delete remains available offline (to queue for later sync), per TT-7521.

Changes:

  • Added canEditAudio to PlanContext state and attempted to apply offline gating only to canEditSheet.
  • Updated AudioTab to use canEditAudio (instead of canEditSheet) for upload UI visibility and read-only behavior.
  • Updated several Cypress component tests’ PlanContext state stubs to include canEditAudio.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/renderer/src/context/PlanContext.tsx Introduces canEditAudio and applies offline logic intended to restrict only structural edits.
src/renderer/src/components/AudioTab/AudioTab.tsx Switches audio tab editing controls from canEditSheet to canEditAudio.
src/renderer/src/components/Sheet/PlanView.cy.tsx Updates PlanContext mock state with canEditAudio.
src/renderer/src/components/Sheet/PlanTabSelect.cy.tsx Updates PlanContext mock state with canEditAudio.
src/renderer/src/components/Sheet/PlanBar.cy.tsx Updates PlanContext mock state with canEditAudio.
src/renderer/src/components/Sheet/PassageRef.cy.tsx Updates PlanContext mock state with canEditAudio.
src/renderer/src/components/Sheet/PassageCard.cy.tsx Updates PlanContext mock state with canEditAudio.

Comment on lines +82 to +85
const structuralOffline = isOffline && !offlineOnly;
const canEditSheet =
canEditSheetPerm || (addStoryOrPassage && !structuralOffline);
const canEditAudio = canEditSheetPerm || addStoryOrPassage;
@gtryus
gtryus marked this pull request as draft July 15, 2026 16:40
@gtryus
gtryus marked this pull request as ready for review July 15, 2026 17:21
@gtryus
gtryus merged commit 89f9698 into develop Jul 15, 2026
2 checks passed
@gtryus
gtryus deleted the feature/TT-7521-no-offline-sheet-change branch July 15, 2026 17:21
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