Skip to content

SF-3825 Allow parallel editor view even when a source isn't set#3952

Open
pmachapman wants to merge 1 commit into
masterfrom
fix/SF-3825
Open

SF-3825 Allow parallel editor view even when a source isn't set#3952
pmachapman wants to merge 1 commit into
masterfrom
fix/SF-3825

Conversation

@pmachapman

@pmachapman pmachapman commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

This PR adds an "always on" left hand tab pane, which when empty will show an "new tab" tab (I'm not sure on the wording/layout of this tab, so am really open to suggestions):

image

This change is Reviewable

@pmachapman pmachapman temporarily deployed to screenshot_diff June 16, 2026 02:24 — with GitHub Actions Inactive
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.16667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.87%. Comparing base (6259e97) to head (4a4dea2).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ntApp/src/app/translate/editor/editor.component.ts 76.19% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3952      +/-   ##
==========================================
- Coverage   80.88%   80.87%   -0.01%     
==========================================
  Files         634      634              
  Lines       41019    41033      +14     
  Branches     6674     6675       +1     
==========================================
+ Hits        33179    33187       +8     
- Misses       6789     6792       +3     
- Partials     1051     1054       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@pmachapman pmachapman marked this pull request as ready for review June 16, 2026 02:30
@pmachapman pmachapman added will require testing PR should not be merged until testers confirm testing is complete e2e Run e2e tests for this pull request labels Jun 16, 2026
@pmachapman pmachapman removed the e2e Run e2e tests for this pull request label Jun 16, 2026
@RaymondLuong3 RaymondLuong3 self-assigned this Jun 18, 2026
@RaymondLuong3 RaymondLuong3 requested a review from Copilot June 18, 2026 19:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds an “always on” left-hand tab pane in the translation editor so users can keep a parallel view even when no source project is configured, using a non-persisted “blank” tab as the empty-state UI.

Changes:

  • Introduces a new blank-tab editor tab type (non-closeable / non-movable / non-persisted) with i18n header + notice text.
  • Updates editor tab-state behavior to ensure an empty tab group shows the blank tab, and adjusts small-screen consolidation/deconsolidation behavior accordingly.
  • Simplifies editor layout logic by removing showSource-gated UI behavior and updating affected unit tests.

Reviewed changes

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

Show a summary per file
File Description
src/SIL.XForge.Scripture/ClientApp/src/assets/i18n/non_checking_en.json Adds English strings for the blank tab header and empty-state notice.
src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/tabs/editor-tab-factory.service.ts Adds factory support for creating the new blank-tab tab.
src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor.component.ts Implements blank-tab add/remove logic; updates consolidation logic and tab placement behavior.
src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor.component.spec.ts Updates/removed tests that depended on showSource behavior.
src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor.component.scss Adds styles for the blank tab notice container.
src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor.component.html Always renders the two-pane tab layout and adds template content for blank-tab.
src/SIL.XForge.Scripture/ClientApp/src/app/shared/sf-tab-group/tab-state/tab-state.service.ts Makes deconsolidateTabGroups() return a boolean indicating whether deconsolidation occurred.
src/RealtimeServer/scriptureforge/models/editor-tab.ts Adds blank-tab to the shared tab-type model and exports editorTabGroupTypes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +158 to +164
.blank-tab-container {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 80%;
}
? (this.tabState.getTabGroup(groupId)?.tabs ?? []).slice()
: tabs.filter(t => t.groupId === groupId);
if (groupTabs.length === 0 && blankTab == null) {
// Add the blank tab, if there are no tabs the tab group
/**
* Restores tabs moved from last consolidation into their original groups.
*
* @returns `true` if the tabs were deconsolidated, `false ` if there was no need to.
Comment on lines +1445 to +1449
private addBlankTab(tabs: FlatTabInfo<EditorTabGroupType, EditorTabInfo>[] | undefined = undefined): void {
for (const groupId of this.visibleTabGroups) {
// For each tab group (i.e. source and target)
const blankTab = this.tabState.getFirstTabOfTypeIndex('blank-tab', groupId);
const groupTabs: EditorTabInfo[] =

@RaymondLuong3 RaymondLuong3 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am getting an error at runtime. I am only able to test this behaviour if I hardcode values for editorTabGroupTypes.
image.png

It seems to me that is should be the responsibility of the tab group component to show the empty state instead of the host components to generate empty pages. Is this feasible?

@RaymondLuong3 reviewed 8 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on pmachapman).


src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor.component.ts line 1454 at r1 (raw file):

          : tabs.filter(t => t.groupId === groupId);
      if (groupTabs.length === 0 && blankTab == null) {
        // Add the blank tab, if there are no tabs the tab group

Nit: That should say 'if there are no tabs in the tab group'

Code quote:

 // Add the blank tab, if there are no tabs the tab group

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

will require testing PR should not be merged until testers confirm testing is complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants