TT-7521 no offline sheet change#430
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
canEditAudiotoPlanContextstate and attempted to apply offline gating only tocanEditSheet. - Updated
AudioTabto usecanEditAudio(instead ofcanEditSheet) 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
marked this pull request as draft
July 15, 2026 16:40
gtryus
marked this pull request as ready for review
July 15, 2026 17:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.