Skip to content

PT-4068/PT-4069: Add Comments tab to Column 3 in Simple mode#2500

Merged
tombogle merged 17 commits into
mainfrom
pt-4068-add-comments-tab-to-column-3
Jul 11, 2026
Merged

PT-4068/PT-4069: Add Comments tab to Column 3 in Simple mode#2500
tombogle merged 17 commits into
mainfrom
pt-4068-add-comments-tab-to-column-3

Conversation

@tombogle

@tombogle tombogle commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Branch: pt-4068-add-comments-tab-to-column-3

Base: origin/main

Date: 2026-07-08

Review model: Claude Fable 5

Files changed: 24 (23 at review start; .gitignore reverted to base and 2 renderer/test files touched by review fixes)

Overview

This review pass covers the latest commits and staged changes since the last review pass on the PT-4068 PR (Comments tab in Column 3 of Simple mode). The changes are mostly (a) improved/added comments and documentation, and (b) reliability work for the new E2E tests: pre-configuring locale/interface-mode before app launch, UUID-based locale-independent selectors (data-web-view-id), retry/re-check logic for the "Replacing tab failed" dock race, overlay-clear waits, and E2E test-organization docs.

During the interview, a pre-existing behavior gap was found and fixed: openOrUpdateRelatedPanels (formerly openTextConnectionPanels) ran for any project opened in simple mode, including read-only published resources — which would have re-pointed the model text, Bible texts, Commentaries, and (new in this PR) Comments panels at the resource. The call is now gated on the project being editable, and the E2E tests were aligned to call openScriptureEditor (semantically correct for the editable fixture projects) instead of openResourceViewer.

API Changes

  • extensions/src/legacy-comment-manager/src/types/legacy-comment-manager.d.ts (papi-shared-types / CommandHandlers): Added 'legacyCommentManager.openCommentListPanel': (projectId?: string | undefined) => Promise<string | undefined> — new command, additive only.
  • lib/platform-bible-react/: no changes.
  • lib/platform-bible-utils/: no changes.
  • lib/papi-dts/papi.d.ts (@papi/ modules): no changes.
  • Note: openTextConnectionPanels was renamed to openOrUpdateRelatedPanels in extensions/src/platform-scripture-editor/src/platform-scripture-editor.utils.ts. This is an extension-internal module, not a public API surface; zero references to the old name remain.

Findings

Critical — Must address before merge

None.

Important — Should address before merge

  • Non-falsifiable test in localized-strings.test.ts: the "Spanish label differs from the Spanish Commentaries tab title" test read %webView_resourcePanel_commentaries_title% from legacy-comment-manager's strings file, but the key lives in platform-scripture-editor's file, so the comparison was always against undefined and could never fail. (fixed during review: test now loads platform-scripture-editor's localizedStrings.json via a shared readLocalizedStrings helper and asserts the Commentaries key toBeDefined() so a future rename fails loudly)
  • Lint error (CI-failing) in localized-strings.test.ts: eslint-disable without required justification comment + prettier warnings. (fixed during review: justification added as part of the test rewrite; file lints clean)
  • Lint error (CI-failing) in e2e-tests/fixtures/helpers.ts: eslint-disable no-type-assertion in preConfigureSettings without justification + prettier warning. (fixed during review: justification comment added; prettier applied)
  • Lint error (CI-failing) in comments-tab.spec.ts: continue in the retry loop flagged by no-continue. (fixed during review: condition inverted to throw in the non-retry case and fall through otherwise; behavior unchanged)
  • Prettier violation in platform-tab-title.component.tsx: data-web-view-id pushed the <div> past print width. (fixed during review: prettier applied — one attribute per line)
  • JSDoc contradicted behavior of openCommentListPanel: claimed projectId: undefined shows an empty panel, but an already-open panel keeps its current project because undefined doubles as the sentinel's "no pending value". This is the same issue Devin review flagged; the team decision (recorded on the PR) was to accept it as a known limitation since clearing an active project is never needed in Simple mode. (fixed during review: JSDoc and sentinel comment now document the actual behavior and the accepted limitation)
  • Replace-tab re-check was ineffective in power mode (platform-scripture-editor/src/main.ts): re-resolving with the caller-supplied existingTabIdToReplace returns the same gone tab id in power mode, so openWebView would still throw. (fixed during review: re-check gated to interfaceMode === 'simple' — the race source, openOrUpdateRelatedPanels, only runs there; also avoids an extra getAllOpenWebViewDefinitions round trip in power mode)
  • Related panels updated for read-only resource opens in simple mode (found during interview; pre-existing gap made user-visible by the new Comments panel): opening a published resource (e.g. from Get Resources) re-pointed all four related panels — including Comments — at the resource project. (fixed during review: openOrUpdateRelatedPanels call gated on projectForWebView.isEditable; E2E tests aligned to call openScriptureEditor instead of openResourceViewer — see Interview Notes)
  • Mismatched meanings across locales for %webView_legacyCommentManager_commentListPanel_title% (en "Comments" vs es "Comentarios de proyecto") (deliberate: in the Spanish Simple UI the Comments and Commentaries ("Comentarios bíblicos") tabs sit side-by-side and must be clearly distinct — both cannot say "Comentarios"; in English the comments/commentaries distinction is judged self-explanatory. Final wording awaits UX research covering both upgrading P9 users and new P10 users. The floating comment list (power) and the fixed tab (simple) will soon never be visible simultaneously, so the same-locale duplicate-title concern does not apply.)
  • No fallbackKey for the new title key: users in languages other than en/es would see English "Comments" on the Column 3 panel even though the equivalent tab title is localized via Paratext fallback. (fixed during review: same fallbackKey as %webView_legacyCommentManager_commentList_title% added. Author notes it is possible-but-unlikely this yields the same word for both tabs in some language — which underscores the need to eventually ensure good P10 localization.)

Minor — Consider

  • focus-existing re-resolve edge case (platform-scripture-editor/src/main.ts): if the simple-mode re-resolve returns focus-existing (an editor for the same (projectId, isReadOnly) appeared concurrently — plausibly via the default project picker reacting to web-view-open events during dock rebuilds), the final openWebView treats it like open-new and creates a duplicate editor (deferred: the re-resolve block is new in this PR, but before it the same race simply threw "Replacing tab failed" — the rare-race outcome changed from a hard error to a possible duplicate tab. Author judged the realistic trigger window not winnable in practice and not this PR's concern. The future fix would mirror the existing focus-existing early return:)

    // Mirror the focus-existing early return above: an editor for this (projectId, isReadOnly)
    // appeared during openOrUpdateRelatedPanels — bring it to the front instead of duplicating it.
    // emitDidFinish still runs so the workspace-updating overlay is not left stuck.
    if (finalDispatch.kind === 'focus-existing') {
      return papi.webViews
        .openWebView(SCRIPTURE_EDITOR_WEBVIEW_TYPE, undefined, {
          existingId: finalDispatch.existingId,
          createNewIfNotFound: false,
          bringToFront: true,
        })
        .finally(emitDidFinish);
    }
  • data-web-view-id emitted on non-WebView tabs (platform-tab-title.component.tsx): the attribute used the dock tab id for every tab, misleading for non-WebView tabs. (fixed during review: new optional webViewId prop; platform-dock-tab.component.tsx passes it only when tabInfo.tabType === TAB_TYPE_WEBVIEW, so the attribute is omitted elsewhere. E2E selectors unaffected — their targets are WebView tabs.)

  • preConfigureSettings permanently switched the developer's dev profile to English/simple mode while its JSDoc claimed state preservation. (fixed during review: it now snapshots the original file contents and returns a restore function; comment.fixture.ts calls it in worker teardown after the app closes. If the file did not exist, restore deletes it.)

  • Duplicated defs→editors mapping in platform-scripture-editor/src/main.ts (same comment + eslint-disable twice) and the new resilience logic was not unit-testable. (fixed during review: extracted toScriptureEditorInfos (+ ScriptureEditorInfo type) into platform-scripture-editor.utils.ts; both call sites use it; 4 new unit tests cover filtering, mapping, isReadOnly defaulting, and empty input — 89/89 tests in the file pass)

  • Ternary in comment-list-panel.utils.ts equivalent to a ?? chain. (fixed during review: pending ?? fromOptions ?? fromSaved; the 4 priority unit tests still pass)

  • Naming inconsistency COMMENT_LIST_PANEL_WEBVIEW_TYPE vs the file's existing camelCase commentListWebViewType. (fixed during review: renamed to commentListPanelWebViewType; neither the local Code-Style-Guide nor the paranext wiki style guide prescribes constant casing, so the file's pre-existing convention wins)

  • Panel provider is an object literal with a module-level mutable sentinel while its in-file sibling uses the class-based WebViewFactory pattern ("state tracking needed → use class") (dismissed: the provider deliberately mirrors its functional siblings — modelTextPanelWebViewProvider and the resource text panel providers in platform-scripture-editor use exactly this object-literal + reload-sentinel shape. Flagged for review: which pattern should the reload-sentinel panels converge on?)

  • Overlay-gone wait duplicated 4× across helpers.ts and comments-tab.spec.ts. (fixed during review: extracted waitForOverlayGone(page, timeout) into helpers.ts; the .pr-twp [role="status"] selector now has one home)

  • Inline import('@playwright/test').Page repeated 3× in the spec. (fixed during review: single top-level import type { Page })

  • Sentence-case test asserts on translation content (localized-strings.test.ts): would fail on a legitimate future translation containing a proper noun/acronym (dismissed as-is; flagged for review: the suite's main purpose is ensuring uniqueness vs. the Commentaries tab, so this particular test is probably not really necessary — tweak or scrap it if a legitimate proper-noun localization ever arrives)

  • .gitignore scope creep: /.claude/*.lock and /.claude/settings.local.json were unrelated to PT-4068. (fixed during review: removed from this branch — .gitignore now matches the merge base. Plan: include them in a separate housekeeping branch/PR together with the stashed stop-processes.mjs change, stash commit f5e77a08. Until then .claude/scheduled_tasks.lock shows as untracked locally and must not be committed.)

  • waitForAppReady default timeout raised 60s→90s + new overlay wait — silently extends worst-case runtime for all E2E suites using it (dismissed: leave as is; will be re-evaluated in a subsequent pass — see the timeout/reliability follow-on task in Interview Notes)

  • "WebView" → "web view" in error messages diverges from the design-guide terminology page (dismissed: deliberate — matches the prevailing "web view" wording used in the dozens of similar provider-mismatch messages across the codebase; changing all the others to "WebView" was judged not worth it)

Template Propagation

Shared Regions Modified

None. (No changed file contains a #region shared with marker.)

Extension Config Changes

  • [n/a] extensions/src/legacy-comment-manager/contributions/localizedStrings.json — extension-specific content, no propagation needed
  • [n/a] extension source under legacy-comment-manager/ and platform-scripture-editor/ — no propagation needed
  • [n/a] e2e-tests/playwright.config.ts, .gitignore — repo-root files, not extension template files

Positive Observations

  • The only public API change is purely additive; the .d.ts declaration, command registration metadata, and handler signature are all consistent, and both new registrations are added to context.registrations for cleanup.
  • resolveCommentListPanelProjectId extracted as a pure, well-documented utility with unit tests covering all four priority combinations; the existingId: '?' / createNewIfNotFound: false / bringToFront: false probe matches the documented OpenWebViewOptions contract exactly.
  • openCommentListPanel passes bringToFront: false on project-switch reloads so focus is not stolen from the Scripture editor; the panel reuses the existing comment list webview content and theming, keeping the Column 3 panel and standalone Comments tab consistent.
  • The new panel title is properly localized (correct alphabetical insertion, en+es, resolved via papi.localization.getLocalizedString) — no hardcoded UI strings anywhere in the new code.
  • E2E selectors use the stable data-web-view-id attribute instead of localized tab text — locale-independent, with the rc-tabs overflow-clipping behavior thoughtfully handled and documented.
  • The getAllOpenWebViewDefinitions timeout fallbacks degrade gracefully with clear warnings rather than throwing, and each fallback's reasoning is documented inline.
  • openOrUpdateRelatedPanels wraps the comments-panel command in try/catch matching the sibling panels, so a comments-panel failure cannot break editor opening.
  • simple-layout.data.test.ts was updated in lockstep with the layout change, keeping the layout invariants enforced.
  • The new E2E test-organization docs (e2e-tests/CLAUDE.md, per-directory READMEs, playwright.config.ts comment) codify conventions clearly, including warning away from the legacy directories.

Interview Notes

  • Stated purpose: review the latest commits and staged changes since the last review pass — mostly improved/added comments plus changes to make the new E2E tests pass reliably.
  • Localization strategy (title key): the author explained the en/es asymmetry is deliberate (see the dismissed Important finding). Final wording awaits UX research; the shared fallbackKey was accepted knowing the small cross-language collision risk.
  • Sentinel limitation: the author connected the JSDoc finding to the earlier Devin-review discussion and the recorded decision to accept the limitation rather than add a hasPending flag; the fix was documentation, not behavior.
  • openOrUpdateRelatedPanels gating: the author's instinct that only the editable path should trigger related panels was verified as correct against the code; the gap pre-existed the branch (as openTextConnectionPanels) but became user-visible with the Comments panel. Fixed with a one-line editability gate.
  • Author uncertainty (resolved during interview): the author was "not very sure" whether the openResourceViewer retry logic in the E2E spec was still needed, and suspected the comment tests shouldn't call openResourceViewer directly. Analysis confirmed: the retry remains justified as defense-in-depth (the app-side re-check's timeout fallback can still throw), the PT-4069 test must go through the editor-open command (not openCommentListPanel) because the integration under test is "active project change → Comments tab follows", and the tests were switched to the semantically correct openScriptureEditor.
  • Not verified in this session: the E2E suite was NOT re-run after the in-review changes (unit tests, lint, typecheck, and formatting were). A full E2E re-run is recommended before merge.
  • Follow-on task (author): when re-running the E2E tests, evaluate whether the reliability improvements allow shorter timeouts (including the waitForAppReady 90s default) or measurably better reliability.
  • Separate PR plan: the .claude .gitignore entries removed from this branch should ship in a housekeeping branch/PR together with the stashed stop-processes.mjs change (stash commit f5e77a08).

In-Review Quality Check

  • npm run typecheck — passed (only the known pre-existing, unrelated PARAGRAPH_STRUCTURE_VIEW_MODE error in platform-scripture-editor.web-view.tsx from @eten-tech-foundation/platform-editor).
  • npm run lint — passed, 0 errors (5 pre-existing no-console warnings in files untouched by this review).
  • Prettier over all 24 changed files — clean, no fixes needed.
  • npm test — all review-related workspaces pass, including the new localized-strings.test.ts, comment-list-panel.utils.test.ts (4 tests), and platform-scripture-editor.utils.test.ts (89 tests incl. 4 new toScriptureEditorInfos tests). The only failure was environmental: lib/platform-bible-react (untouched) could not launch its vitest browser mode because the local Playwright chromium-headless-shell binary was missing; it was installed machine-level for future runs.
  • No code fixes were required by the quality checks.

Suggested Review Focus

Prioritized areas for the author-reviewer meeting:

  • Editability gate on openOrUpdateRelatedPanels (platform-scripture-editor/src/main.ts open()): simple-mode opens of read-only published resources no longer update the related panels. This is a behavior change slightly beyond the PR's comments scope (it also affects model text / Bible texts / Commentaries panels) — confirm it matches the intended simple-mode UX for opening resources.
  • E2E re-run before merge, then the follow-on evaluation of whether timeouts can be shortened given the reliability fixes.
  • Provider pattern for reload-sentinel panels: object literal + module-level sentinel (current, matching platform-scripture-editor's panels) vs class-based WebViewFactory per the extension-patterns guidance — pick a direction for future panels.
  • Sentence-case localization test: probably unnecessary given the suite's uniqueness purpose — keep, tweak, or scrap.
  • focus-existing re-resolve edge case: deferred with a ready-to-apply snippet (above) — decide whether to ticket it.
  • Comments/Commentaries tab wording (en "Comments" / es "Comentarios de proyecto"): pending UX research; the shared fallbackKey may yield identical words in some locales.

Summary

  • Adds a "Comments" tab as a fixed third tab in Column 3 of Platform.Bible Simple mode (PT-4068)
  • Wires the tab to automatically reload when the active project changes in Column 2 (PT-4069)
  • Registers legacyCommentManager.commentListPanel WebView provider and legacyCommentManager.openCommentListPanel PAPI command in legacy-comment-manager
  • Calls openCommentListPanel from openOrUpdateRelatedPanels (renamed from openTextConnectionPanels) in platform-scripture-editor
  • Dedicated localization key %webView_legacyCommentManager_commentListPanel_title% (en: "Comments", es: "Comentarios de proyecto") so the panel tab and floating list can diverge independently
  • E2E tests in tests/isolated/ for tab visibility, panel rendering, comments content, Spanish label, and project-tracking (PT-4069)

Changes made during review (both sessions)

  • bringToFront: false added to the existingId: '?' probe call in openCommentListPanel — the omission caused the Comments panel to briefly steal focus on every project switch
  • Extracted resolveCommentListPanelProjectId into comment-list-panel.utils.ts with 4 unit tests covering the sentinel priority chain
  • Dedicated localization key (instead of changing the existing floating-list key)
  • openTextConnectionPanels renamed to openOrUpdateRelatedPanels
  • JSDoc updated to describe behavior rather than callers
  • Error message casing normalized ("WebView""web view")
  • E2E spec moved to tests/isolated/; READMEs added to all standard E2E directories; e2e-tests/CLAUDE.md added documenting test placement conventions

Known limitations / reviewer notes

  • Sentinel ambiguity: currentCommentListPanelProjectId uses undefined as both sentinel and valid value; openCommentListPanel(undefined) when a panel is open would silently keep the old project. Accepted: this path is never taken in current UX (Simple mode doesn't allow clearing a project). Mirrors the same pattern as currentModelTextProjectId in platform-scripture-editor.
  • PT-4088: The colon+project-name append in the floating comment list title is a known localization concern, deferred to a follow-up.
  • Floating list in Simple mode: Two tabs titled "Comments" could appear if both the panel and a floating list are open. Accepted: the floating list will eventually be made inaccessible in Simple mode (future work).

Test plan

  • Unit tests: comment-list-panel.utils.test.ts (4 tests, all pass)
  • Unit test: simple-layout.data.test.ts updated (tab count 2→3)
  • lint / format / typecheck: clean (pre-existing unrelated typecheck failure in platform-scripture-editor.web-view.tsx)
  • E2E (local): 2/5 tests pass when app boots cleanly; 3/5 fail due to pre-existing first-Electron environment issue on the review machine (same failure seen in comment-assignment isolated tests — not introduced by this PR)

AI-assisted — session 1, session 2, session 3


This change is Reviewable

@tombogle tombogle self-assigned this Jul 2, 2026
@tombogle

tombogle commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Devin review found a potential bug. Here is the prompt it suggests feeding into Claude:

The module-level variable currentCommentListPanelProjectId uses undefined as both the sentinel for no pending value and as a valid pending value (meaning clear the project). This means passing undefined to openCommentListPanel when an existing panel is open will silently keep the old project.

The fix should use a pattern that distinguishes no pending value from pending-with-undefined. The sibling code in extensions/src/platform-scripture-editor/src/main.ts:870-876 uses a Map with has() for this purpose. For a single variable, you could use a wrapper object like { hasPending: boolean; projectId: string | undefined } or a dedicated boolean flag like hasPendingCommentListPanelProjectId. The key change is in the getWebView method: instead of checking currentCommentListPanelProjectId !== undefined, check whether a pending value was set at all, and if so use it even if it is undefined.

I'm not actually sure if this is likely to be a real problem since we will seldom (never???) want to clear out the active project after once successfully setting one. (The only time that could maybe happen, I think, would be if we deleted the only project, but since deleting a project can't be done in Simple mode, that's probably not a real scenario.)

Claude's recommendation: record Devin's finding as a known limitation in the summary (alongside the race condition), but don't fix it unless you want to. The fix is straightforward — add a boolean flag:

let pendingCommentListPanelProjectId: string | undefined;
let hasPendingCommentListPanelProjectId = false;
— but it adds complexity that buys nothing in the current UX. If the UX ever changes to allow clearing a project in Simple mode, fix it then.

@tombogle

tombogle commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Devin also detected that Comments panel is not verse-synced with the scripture editor in simple mode. I am deferring this to PT-4080.

@katherinejensen00 katherinejensen00 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.

Great work, Tom! The feature is sound and follows the existing Column-3 panel patterns faithfully. Only one thing I'd fix before merge (a misleading code comment that Claude found); the rest are optional cleanups and a suggestion to split out the unrelated housekeeping. Even the comment is minor so I went ahead and approved the changes.

@katherinejensen00 reviewed 18 files and all commit messages, and made 9 comments.
Reviewable status: all files reviewed, 8 unresolved discussions (waiting on tombogle).


e2e-tests/tests/isolated/comments-tab.spec.ts line 201 at r1 (raw file):

      // Switch to Project B — triggers openOrUpdateRelatedPanels(projectB.projectId)
      await sendPapiRequestOnce(
        'command:platformScriptureEditor.openResourceViewer',

NIT Claude Finding

Summary: The PT-4069 project-switch test dispatches a PAPI command rather than driving the switch through the UI, so it verifies the wiring more than the user journey.

Per the Testing-Guide UI-Only Interaction Rule (Testing-Guide.md:1054-1062), per-feature tests should switch projects through visible controls. This test switches via command:platformScriptureEditor.openResourceViewer (:186, :201). I'll note the mitigating context: comment.fixture is a pre-existing, already-sanctioned fixture (used by the comment-assignment tests), and the locale/mode setup genuinely has no UI path — so this is not a blocker. But the project switch does have a UI path; if it's practical, driving it through the UI (or a one-line comment justifying the command-based approach) would make the test prove the real flow.


e2e-tests/tests/manage-books/README.md line 3 at r1 (raw file):

# manage-books E2E Tests

> **Note:** These tests are experimental and are **not wired into any standard test run**

Will they ever not be experimental?


e2e-tests/tests/markers-checklist/README.md line 3 at r1 (raw file):

# markers-checklist E2E Tests

> **Note:** These tests are experimental and are **not wired into any standard test run**

Will they ever not be experimental?


e2e-tests/tests/smoke/README.md line 14 at r1 (raw file):

Feature-specific or state-mutating tests belong in `isolated/` instead.

This is nice. I like the option to run it separately since e2e tests tend to be a bit flaky so they aren't great for CLI, but are helpful when developing in a similar area.


extensions/src/legacy-comment-manager/src/comment-list-panel.utils.ts line 4 at r1 (raw file):

 * Resolves the projectId to display in the Comment List Panel.
 *
 * Priority: pending sentinel (set by openCommentListPanel before reloadWebView) >

NIT Claude Finding (comment clarification)

Summary: The priority-chain JSDoc is garbled by a stray > that splits the sentence into a spurious blockquote.

Lines 4-7 render as "Priority: pending sentinel (…) > openWebViewOptions" then, after a blank comment line, "> SavedWebView. The sentinel exists because…" — the > separating openWebViewOptions and SavedWebView got orphaned onto its own line and reads as a Markdown blockquote. Reflow to one line: Priority: pending sentinel > openWebViewOptions > SavedWebView. (Compare the clear inline version at platform-scripture-editor/src/main.ts:847.)


extensions/src/legacy-comment-manager/src/main.ts line 167 at r1 (raw file):

 */
async function openCommentListPanel(projectId: string | undefined): Promise<string | undefined> {
  // Use existingId: '?' to detect-and-reuse the fixed Column 3 tab without calling

NIT Claude Finding (Comment clarification)

Summary: The comment justifying existingId: '?' states something that isn't true — getAllOpenWebViewDefinitions is available from extension-host context, so the rationale is misleading even though the code works.

The comment says we use existingId: '?' "without calling getAllOpenWebViewDefinitions (which is not reliably available from extension context)." But the two sibling Column-3 panels this feature mirrors call it from extension-host context in the very same openOrUpdateRelatedPanels flow — openModelText (platform-scripture-editor/src/main.ts:1207) and openResourceText (:942) — and it's also used at main.ts:246 and platform-scripture/src/hooks/use-open-project-tabs.ts:111. The existingId: '?' approach itself is fine and documented, so nothing needs to be re-architected — but please just delete or correct the parenthetical, since it will mislead the next maintainer. (Note: don't "fix" it by switching to the sibling mechanism — this panel deliberately reloads with bringToFront: false whereas the siblings use true, so they aren't drop-in equivalent.)


extensions/src/legacy-comment-manager/src/types/legacy-comment-manager.d.ts line 439 at r1 (raw file):

     *
     * @param projectId The project whose comments to display
     * @returns The webView ID of the panel

NIT Claude Finding (pretty nitpicky but could be helpful for intellisense)

Summary: The public command's @returns doesn't mention it can resolve to undefined.

The declared type is Promise<string | undefined> and the implementation's own JSDoc documents the undefined-on-failure case, but this papi-shared-types CommandHandlers entry — the surface other extensions see in IntelliSense — omits it. The sibling openCommentList entry (line ~425) documents its undefined case. Suggest matching that.


extensions/src/platform-scripture-editor/src/platform-scripture-editor.utils.ts line 912 at r1 (raw file):

/**
 * Opens or updates the model text, commentary, and scripture resource panels for a project.

NIT Claude Finding (Minor clarification)

Summary: After the rename, the JSDoc, @param, and region label still describe the old "text connections" concept and don't mention the comment-list panel this PR adds.

The function is now openOrUpdateRelatedPanels and opens a fourth panel (the comment list, line 945), but: the summary (:912) lists only "model text, commentary, and scripture resource panels"; the @param (:915) still says "open the text connections for"; and the region markers (:909 / :951) still read Text Connection Panels. Suggest refreshing all three to the "related panels" framing.

@tombogle tombogle left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@tombogle made 3 comments and resolved 6 discussions.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on katherinejensen00 and lyonsil).


e2e-tests/tests/manage-books/README.md line 3 at r1 (raw file):

Previously, katherinejensen00 wrote…

Will they ever not be experimental?

I don't know. This is just what @lyonsil told me. Presumably if they things they test get fully implemented, they could be reworked to test them and then they would get moved and wired into a standard test run, at which point this comment and the readmes would be changed or go away.


e2e-tests/tests/markers-checklist/README.md line 3 at r1 (raw file):

Previously, katherinejensen00 wrote…

Will they ever not be experimental?

see above


extensions/src/legacy-comment-manager/src/main.ts line 167 at r1 (raw file):

Previously, katherinejensen00 wrote…

NIT Claude Finding (Comment clarification)

Summary: The comment justifying existingId: '?' states something that isn't true — getAllOpenWebViewDefinitions is available from extension-host context, so the rationale is misleading even though the code works.

The comment says we use existingId: '?' "without calling getAllOpenWebViewDefinitions (which is not reliably available from extension context)." But the two sibling Column-3 panels this feature mirrors call it from extension-host context in the very same openOrUpdateRelatedPanels flow — openModelText (platform-scripture-editor/src/main.ts:1207) and openResourceText (:942) — and it's also used at main.ts:246 and platform-scripture/src/hooks/use-open-project-tabs.ts:111. The existingId: '?' approach itself is fine and documented, so nothing needs to be re-architected — but please just delete or correct the parenthetical, since it will mislead the next maintainer. (Note: don't "fix" it by switching to the sibling mechanism — this panel deliberately reloads with bringToFront: false whereas the siblings use true, so they aren't drop-in equivalent.)

Fixed the comment. FWIW, in the app I just tried changing the active project a couple times, and regardless of which tab or pane had focus, the focus is always set to the main editor pane, and the first tab "Bible Texts" is always the one shown in column 3. So whatever bringToFront:true may be doing or claiming to do, it does not seem to have the final say.

@katherinejensen00 katherinejensen00 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.

Thanks for making those changes. Looks great!

@katherinejensen00 reviewed 5 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on lyonsil).

@tombogle

tombogle commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@katherinejensen00 Note that the production-code changes in extensions/src/platform-scripture-editor/src/main.ts have not yet be run through -review-paratext. They were made as part of getting the e2e tests to work more reliably, but I don't fully understand them or know whether they are actual improvements.

@katherinejensen00 katherinejensen00 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.

Good to know. Thanks!

@katherinejensen00 reviewed 4 files and all commit messages, made 2 comments, and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on lyonsil).


e2e-tests/tests/manage-books/README.md line 3 at r1 (raw file):

Previously, tombogle (Tom Bogle) wrote…

I don't know. This is just what @lyonsil told me. Presumably if they things they test get fully implemented, they could be reworked to test them and then they would get moved and wired into a standard test run, at which point this comment and the readmes would be changed or go away.

Fair enough. I trust Matt L, let's go with what he said.

@katherinejensen00 katherinejensen00 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.

2 super minor optional improvements that you could make in another PR or not at all.

@katherinejensen00 reviewed 14 files and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on lyonsil and tombogle).


e2e-tests/tests/isolated/comments-tab.spec.ts line 218 at r4 (raw file):

    const commentsFrame = commentsFrameLocator(mainPage);
    await commentsFrame.locator('body').waitFor({ state: 'attached', timeout: 15_000 });

NIT Claude Finding

This test only waits for the iframe body to reach attached, which is true as soon as the frame element exists — so it doesn't actually verify the panel displayed anything, despite the test name. It would pass on a panel that mounts empty, errors, or shows the wrong project. Consider asserting on a stable rendered element inside the panel (a filter control, the empty-state text, or a data-testid) so the assertion matches the test's intent.


extensions/src/platform-scripture-editor/src/main.ts line 255 at r4 (raw file):

    } catch (e) {
      logger.warn(
        `openResourceViewer: getAllOpenWebViewDefinitions timed out or failed (${getErrorMessage(e)}); opening as new tab`,

NIT Claude Finding

Two new warning logs are prefixed openResourceViewer:, but they live inside open() — which serves both the editable Scripture Editor and the read-only Resource Viewer paths — so the prefix is misleading on the editable path. Consider open: (or branch the prefix on isReadOnly) so log triage points at the right entry point. Same fix applies to the re-check log at line 352.

tombogle and others added 16 commits July 11, 2026 14:04
…ents tab tests

Change PAPI_REQUEST_TIMEOUT_MS (30s) to SETTINGS_TIMEOUT_MS (60s) in Tests 3 and 5
to account for slower CI environments during extension registration.

Co-Authored-By: Claude Code <noreply@anthropic.com>
…comment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ventually to become a tooltip) text to diverge from the floating pane title
…egistration

- Add dedicated localization key %webView_legacyCommentManager_commentListPanel_title%
  (Spanish: "Comentarios de proyecto") so panel tab and floating list can diverge
- Revert %webView_legacyCommentManager_commentList_title% Spanish to "Comentarios"
- Rename openTextConnectionPanels → openOrUpdateRelatedPanels to reflect expanded scope
- Fix JSDoc on openCommentListPanel to describe behavior, not callers
- Fix error message casing ("WebView" → "web view") for consistency
- Move E2E spec from simple-mode-comments/ into isolated/ (already-registered project)
- Add READMEs to smoke/, isolated/, enhanced-resources/, manage-books/, markers-checklist/
- Add e2e-tests/CLAUDE.md documenting where new E2E tests belong
- Gitignore Claude Code local settings files (.claude/*.lock, settings.local.json)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Session-URL: <session URL>
…nWebViewDefinitions

getAllOpenWebViewDefinitions is not reliably available from extension context
(JSON-RPC -32601 at runtime). The existingId:'?' + createNewIfNotFound:false
two-call pattern is the documented codebase standard for single-instance
webview reuse (see openManageBooks/openFind in platform-scripture).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- openCommentListPanel's probe openWebView call was missing bringToFront:false,
  causing the Comments panel to briefly steal focus on every project switch.
- Extract resolveCommentListPanelProjectId into comment-list-panel.utils.ts
  so the sentinel priority logic (pending > options > saved) can be unit-tested
  without the ?inline webpack imports that Vitest can't process.
- Add 4 unit tests covering the priority chain and the undefined-all case.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Session-URL: https://claude.ai/code/28cdd4e1-f95f-409e-9721-f18c433482a3
- Fix non-falsifiable Commentaries-title localization test (read the key
  from platform-scripture-editor's strings file; guard with toBeDefined)
- Fix lint errors: disable-comment justifications, no-continue retry loop,
  prettier formatting
- Document accepted sentinel limitation in openCommentListPanel JSDoc
- Gate replace-tab re-check to simple mode (re-resolve could not help in
  power mode)
- Gate openOrUpdateRelatedPanels on project editability so opening a
  read-only resource no longer re-points related panels (incl. Comments)
- Switch comment E2E tests from openResourceViewer to openScriptureEditor
  to match the real user flow for editable fixture projects
- Add fallbackKey for the comment list panel title localization key
- Emit data-web-view-id only for WebView tabs (new webViewId prop)
- Restore developer's dev-appdata settings in E2E worker teardown
- Extract toScriptureEditorInfos into utils with unit tests (dedupe)
- Extract waitForOverlayGone E2E helper; simplify sentinel resolution to
  a ?? chain; rename webview-type constant to camelCase
- Remove .claude .gitignore entries (moving to separate housekeeping PR)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Session-URL: <session URL>
… import TAB_TYPE_WEBVIEW from new location: docking-framework.model.ts

PT-4069: Addressed confusing comments and warning message cause by previous change
@tombogle tombogle force-pushed the pt-4068-add-comments-tab-to-column-3 branch from c5c1422 to 1ee08f0 Compare July 11, 2026 19:14

@tombogle tombogle left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@tombogle resolved 3 discussions.
Reviewable status: 10 of 25 files reviewed, all discussions resolved (waiting on katherinejensen00).

@tombogle tombogle merged commit 4913920 into main Jul 11, 2026
6 of 7 checks passed
@tombogle tombogle deleted the pt-4068-add-comments-tab-to-column-3 branch July 11, 2026 21:22
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