Skip to content

Fix DocCell label truncation and stabilize TipTap build typings#525

Merged
ksalamy merged 7 commits intodevelopfrom
copilot/update-document-titles-for-missions
Apr 1, 2026
Merged

Fix DocCell label truncation and stabilize TipTap build typings#525
ksalamy merged 7 commits intodevelopfrom
copilot/update-document-titles-for-missions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 12, 2026

DocCell was JS-truncating labels to the first 3 words (4 if the 3rd was '-'), making documents with shared prefixes indistinguishable in the list.

This PR now includes two related parts:

1) DocCell label fix (original scope)

  • packages/react-ui/src/Cells/DocCell.tsx: remove word-count JS truncation and render full label.
  • packages/react-ui/src/Cells/DocCell.test.tsx: add regression coverage for long multi-word labels so we keep full accessible button names.

2) TipTap build stability + typing cleanup (required follow-up)

While validating this PR in clean CI installs, @mbari/lrauv-dash2 failed with:

  • Cannot find module '@tiptap/react' or its corresponding type declarations

To make builds deterministic and keep type safety:

  • apps/lrauv-dash2/package.json: pin TipTap deps to 3.13.0 and add explicit @tiptap/extension-heading / @tiptap/extension-paragraph dependencies used by docs editors.
  • yarn.lock: refresh lock entries accordingly.
  • Docs editor typing updates:
    • DocEditorTipTap.tsx, DocEditorToolbar.tsx, DocFormEditor.tsx
    • extensions/CheckboxNode.ts, RadioNode.ts, TextFieldNode.ts, TextAreaNode.ts
    • replace temporary any/@ts-nocheck approaches with explicit TipTap/ProseMirror types.

Validation

  • yarn workspace @mbari/lrauv-dash2 build
  • yarn build (monorepo) ✅

Fixes #514

… words

Co-authored-by: ksalamy <12836105+ksalamy@users.noreply.github.com>
Copilot AI changed the title [WIP] Update documents title for missions to display deployment status Fix DocCell truncating document titles to 3 words Mar 12, 2026
Copilot AI requested a review from ksalamy March 12, 2026 19:58
@ksalamy ksalamy requested a review from Copilot March 16, 2026 22:44
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

Removes the JavaScript word-count truncation in DocCell so document titles render in full (with overflow handled via Tailwind’s truncate styling), making similarly-prefixed document names distinguishable in the documents list.

Changes:

  • Deleted the custom “first 3–4 words” truncation logic in DocCell.
  • Rendered the full label prop directly in the primary button.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 67 to 72
<button
className="w-full truncate text-left font-light text-primary-600"
onClick={swallow(onSelect)}
>
{truncatedLabel}
{label}
</button>
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.

Looks good.

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.

Looks good.

Add a DocCell test case with a long multi-word label to ensure full label text renders and guard against regressions back to JS truncation behavior.
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 fixes document list titles being indistinguishable by removing DocCell’s JavaScript word-count truncation and relying on existing CSS (truncate) to handle overflow while preserving the full label in the DOM/accessibility tree.

Changes:

  • Remove the 3-word (special-cased) truncation logic from DocCell and render label directly.
  • Add a regression test ensuring long multi-word labels render fully (not JS-truncated).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/react-ui/src/Cells/DocCell.tsx Stops truncating labels in JS and renders the full label prop.
packages/react-ui/src/Cells/DocCell.test.tsx Adds coverage for long multi-word labels to prevent regression.

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

You can also share your feedback on Copilot code review. Take the survey.

Copy link
Copy Markdown
Collaborator

@ksalamy ksalamy left a comment

Choose a reason for hiding this comment

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

This should be ready for development testing.

Comment on lines 67 to 72
<button
className="w-full truncate text-left font-light text-primary-600"
onClick={swallow(onSelect)}
>
{truncatedLabel}
{label}
</button>
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.

Looks good.

ksalamy added 2 commits March 16, 2026 16:25
Refresh yarn.lock so @tiptap packages declared by lrauv-dash2 are resolved in clean CI installs and Next.js type-check can find @tiptap/react.
Pin TipTap packages to 3.13.0 and add minimal type-compatibility shims so lrauv-dash2 builds consistently in clean CI installs.
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

Removes DocCell’s JavaScript word-based truncation so document titles remain distinguishable in the documents list, relying on CSS truncation instead. The PR also introduces a set of TipTap dependency/version and TypeScript-typing related changes in apps/lrauv-dash2.

Changes:

  • Render full label text in DocCell (remove 3-word truncation logic).
  • Add a regression test ensuring long multi-word labels render in full.
  • Add/adjust TipTap dependency pins and introduce TypeScript shims/typing relaxations for the TipTap editor code in apps/lrauv-dash2.

Reviewed changes

Copilot reviewed 11 out of 14 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/react-ui/src/Cells/DocCell.tsx Removes JS truncation and renders label directly.
packages/react-ui/src/Cells/DocCell.test.tsx Adds test asserting long label is rendered fully.
package.json Adds extensive TipTap version pins under resolutions.
yarn.lock Large lockfile update bringing in TipTap/ProseMirror-related packages.
apps/lrauv-dash2/package.json Pins TipTap deps to exact versions; adds missing TipTap extensions.
apps/lrauv-dash2/tiptap-react.d.ts Adds ambient module stub for @tiptap/react using any.
apps/lrauv-dash2/tiptap-extensions.d.ts Adds ambient module stubs for many TipTap packages using any.
apps/lrauv-dash2/components/docs/extensions/*.ts Adds // @ts-nocheck to multiple custom TipTap node modules.
apps/lrauv-dash2/components/docs/DocFormEditor.tsx Adjusts callback/handler typings (minimal inline types + any).
apps/lrauv-dash2/components/docs/DocEditorToolbar.tsx Adds explicit any type for storedMarks iteration.
apps/lrauv-dash2/components/docs/DocEditorTipTap.tsx Adjusts onUpdate typing for the editor callback.
Comments suppressed due to low confidence (1)

apps/lrauv-dash2/components/docs/DocFormEditor.tsx:328

  • These editor event handlers introduce any for view/event parameters, which removes type checking in logic that gates keyboard/paste behavior. Prefer using the ProseMirror types (e.g., EditorView and ClipboardEvent/KeyboardEvent) available via @tiptap/pm to keep this logic type-safe.
      handleTextInput: (view: any, from: any, to: any, text: any) => {
        const target = (view.dom.ownerDocument?.activeElement ??
          null) as HTMLElement | null
        if (
          target &&

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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread package.json Outdated
Comment on lines +69 to +105
"@tiptap/extension-paragraph": "3.13.0",
"@tiptap/extension-strike": "3.13.0",
"@tiptap/extension-text": "3.13.0",
"@tiptap/extension-underline": "3.13.0"
Comment on lines 1 to 2
// @ts-nocheck
import { Node, mergeAttributes } from '@tiptap/core'
Comment on lines 1 to 2
// @ts-nocheck
import { Node, mergeAttributes } from '@tiptap/core'
Comment on lines 1 to 2
// @ts-nocheck
import { Node, mergeAttributes } from '@tiptap/core'
Comment on lines 1 to 2
// @ts-nocheck
import { Node, mergeAttributes } from '@tiptap/core'
Comment on lines 318 to 322
onUpdate: ({ editor }: { editor: { getHTML: () => string } }) => {
const current = editor.getHTML()
const diffed = computeDiffHtml(current)
onChange?.(diffed)
},
Remove temporary ambient shims and ts-nocheck usage by applying explicit TipTap/ProseMirror types in docs editor code while keeping the build fix intact.
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 addresses document-list ambiguity by ensuring DocCell displays the full document title (relying on CSS truncation for overflow), and also includes a set of TipTap dependency/type updates in apps/lrauv-dash2.

Changes:

  • Remove JS word-based label truncation in DocCell and render the full label.
  • Add a regression test to ensure long multi-word labels render as the button accessible name.
  • Update TipTap dependencies/types in apps/lrauv-dash2 (package.json + editor/extension typings) and refresh yarn.lock accordingly.

Reviewed changes

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

Show a summary per file
File Description
yarn.lock Adds/updates locked dependencies (notably TipTap/prosemirror-related transitive deps).
packages/react-ui/src/Cells/DocCell.tsx Removes JS truncation and renders label directly.
packages/react-ui/src/Cells/DocCell.test.tsx Adds a test asserting the full long label is present as the button name.
apps/lrauv-dash2/package.json Pins TipTap packages to 3.13.0 and adds explicit heading/paragraph deps.
apps/lrauv-dash2/components/docs/extensions/TextFieldNode.ts Adds explicit TipTap/PM typings for node view + commands.
apps/lrauv-dash2/components/docs/extensions/TextAreaNode.ts Adds explicit TipTap/PM typings for node view + commands.
apps/lrauv-dash2/components/docs/extensions/RadioNode.ts Adds explicit TipTap/PM typings for node view + commands/attrs.
apps/lrauv-dash2/components/docs/extensions/CheckboxNode.ts Adds explicit TipTap/PM typings for node view + commands/attrs.
apps/lrauv-dash2/components/docs/DocFormEditor.tsx Adds explicit TipTap/PM typings for editor callbacks/props.
apps/lrauv-dash2/components/docs/DocEditorToolbar.tsx Adds explicit Mark type for stored-marks check.
apps/lrauv-dash2/components/docs/DocEditorTipTap.tsx Adds explicit Editor typing for onUpdate callback.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +23 to +31
"@tiptap/core": "3.13.0",
"@tiptap/extension-color": "3.13.0",
"@tiptap/extension-highlight": "3.13.0",
"@tiptap/extension-heading": "3.13.0",
"@tiptap/extension-horizontal-rule": "3.13.0",
"@tiptap/extension-link": "3.13.0",
"@tiptap/extension-paragraph": "3.13.0",
"@tiptap/extension-subscript": "3.13.0",
"@tiptap/extension-superscript": "3.13.0",
@ksalamy ksalamy changed the title Fix DocCell truncating document titles to 3 words Fix DocCell label truncation and stabilize TipTap build typings Mar 17, 2026
@ksalamy ksalamy requested a review from Copilot March 17, 2026 01:12
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

Fixes document list ambiguity by removing DocCell’s word-based label truncation, and stabilizes the @mbari/lrauv-dash2 docs editor build by pinning TipTap dependencies and tightening TypeScript typings around TipTap/ProseMirror integration.

Changes:

  • Remove JS word-count truncation in DocCell and rely on rendering the full label (with CSS truncation only).
  • Add a regression test ensuring long multi-word labels remain part of the button’s accessible name.
  • Pin TipTap packages to 3.13.0 in @mbari/lrauv-dash2 and replace prior any/loose typings with explicit TipTap/ProseMirror types in editor code and custom nodes.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
yarn.lock Updates lockfile entries to reflect pinned TipTap ecosystem and related transitive deps.
packages/react-ui/src/Cells/DocCell.tsx Removes JS truncation and renders the full document label.
packages/react-ui/src/Cells/DocCell.test.tsx Adds regression coverage for long labels via accessible button name.
apps/lrauv-dash2/package.json Pins TipTap dependencies to exact 3.13.0 and adds explicit editor extension deps.
apps/lrauv-dash2/components/docs/extensions/TextFieldNode.ts Replaces loose typings with explicit TipTap/ProseMirror types for node views/commands.
apps/lrauv-dash2/components/docs/extensions/TextAreaNode.ts Same typing cleanup for textarea node implementation.
apps/lrauv-dash2/components/docs/extensions/RadioNode.ts Same typing cleanup for radio node implementation.
apps/lrauv-dash2/components/docs/extensions/CheckboxNode.ts Same typing cleanup for checkbox node implementation.
apps/lrauv-dash2/components/docs/DocFormEditor.tsx Adds explicit editor/view/slice types for TipTap update + ProseMirror handlers.
apps/lrauv-dash2/components/docs/DocEditorToolbar.tsx Types stored mark inspection using ProseMirror Mark.
apps/lrauv-dash2/components/docs/DocEditorTipTap.tsx Types TipTap onUpdate callback parameter explicitly.

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

You can also share your feedback on Copilot code review. Take the survey.

@ksalamy
Copy link
Copy Markdown
Collaborator

ksalamy commented Mar 17, 2026

This PR contains two intentionally related parts:

  1. DocCell usability fix
    Removed JS word-based truncation in DocCell so full labels remain distinguishable.
    Added regression test for long multi-word labels and accessible button naming.

  2. Required build-stability follow-up for docs editor
    While validating this PR in clean CI installs, @mbari/lrauv-dash2 failed resolving TipTap modules/types.
    Pinned TipTap deps to 3.13.0 in apps/lrauv-dash2/package.json and refreshed yarn.lock.
    Replaced temporary loose typing approaches with explicit TipTap/ProseMirror types in docs editor/custom node files.
    Validation performed:

yarn workspace @mbari/lrauv-dash2 build ✅
yarn build (monorepo) ✅
GitHub Actions build (18.x) ✅

Focus for review:

packages/react-ui/src/Cells/DocCell.tsx + test change
apps/lrauv-dash2/components/docs/
typing updates
apps/lrauv-dash2/package.json + yarn.lock dependency stabilization impact
*

@ksalamy ksalamy marked this pull request as ready for review March 17, 2026 01:38
@ksalamy ksalamy requested a review from jimjeffers March 17, 2026 01:38
ksalamy added a commit that referenced this pull request Apr 1, 2026
# Conflicts:
#	yarn.lock
@ksalamy ksalamy requested a review from Copilot April 1, 2026 21:53
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 fixes document list ambiguity by removing word-based truncation in DocCell, adds a regression test to ensure full accessible button names for long labels, and stabilizes TipTap/ProseMirror builds in @mbari/lrauv-dash2 by pinning TipTap versions and tightening editor-related typings.

Changes:

  • Render full DocCell labels (no JS word truncation) and add a long-label regression test.
  • Pin TipTap dependencies to 3.13.0 (plus explicit heading/paragraph deps) to prevent CI-only module/type resolution failures.
  • Replace loose any/untyped editor callback parameters with explicit TipTap/ProseMirror types in docs editor components and custom node extensions.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
yarn.lock Updates lockfile entries consistent with pinning/adding TipTap + ProseMirror-related dependencies.
packages/react-ui/src/Cells/DocCell.tsx Removes word-count truncation and renders full label text.
packages/react-ui/src/Cells/DocCell.test.tsx Adds a regression test asserting the full long label is the button’s accessible name.
apps/lrauv-dash2/package.json Pins TipTap deps to exact 3.13.0 and adds explicit heading/paragraph dependencies.
apps/lrauv-dash2/components/docs/extensions/TextFieldNode.ts Adds explicit TipTap/PM types for command/nodeview/update callbacks and HTML parsing helpers.
apps/lrauv-dash2/components/docs/extensions/TextAreaNode.ts Adds explicit TipTap/PM types for command/nodeview/update callbacks and HTML parsing helpers.
apps/lrauv-dash2/components/docs/extensions/RadioNode.ts Adds explicit TipTap/PM types for command/nodeview/update callbacks and attribute parsing.
apps/lrauv-dash2/components/docs/extensions/CheckboxNode.ts Adds explicit TipTap/PM types for command/nodeview/update callbacks and attribute parsing.
apps/lrauv-dash2/components/docs/DocFormEditor.tsx Types onUpdate and ProseMirror editorProps handlers with TipTap/PM types.
apps/lrauv-dash2/components/docs/DocEditorToolbar.tsx Types storedMarks items as ProseMirror Mark.
apps/lrauv-dash2/components/docs/DocEditorTipTap.tsx Types onUpdate callback editor parameter with TipTap Editor.

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

…ument-titles-for-missions

# Conflicts:
#	yarn.lock
@ksalamy
Copy link
Copy Markdown
Collaborator

ksalamy commented Apr 1, 2026

Hey @zachmau — ready for your review!

What this PR does:

  • Removes JS word-truncation from DocCell so full document names render and truncate via CSS only (fixes fix(#514): show vehicle name in browser tab title #524)
  • Adds a regression test for long labels
  • Pins TipTap to 3.13.0 and tightens editor typings to fix a CI-only build failure that was blocking the branch

Review order heads-up: There's a second PR (#528) that also touches DocCell.tsx (adds a colored docType pill). I'd suggest reviewing and merging this one first — #528 is already rebased on top of it.

Copilot reviewed both and had no blocking comments. Thanks!

@ksalamy
Copy link
Copy Markdown
Collaborator

ksalamy commented Apr 1, 2026

Hi Zach — this one has two parts that got linked during validation:

  1. DocCell truncation fix (the original scope) — straightforward removal of the JS word-count logic

  2. TipTap typing cleanup — discovered that clean CI installs were failing without explicit TipTap deps. The docs editor files look changed but it's type-only (replacing any/@ts-nocheck with proper ProseMirror types), no behavior change

One heads-up on review order:
PR #528 (doc type display) also touches DocCell.tsx, so if you could review and merge this one first,
#528 will rebase cleanly on top. I will send a request to review after #525's review is completed.

Happy to answer any questions!

@ksalamy ksalamy merged commit 6a2cf6d into develop Apr 1, 2026
2 checks passed
@ksalamy ksalamy requested review from ZackLyon and removed request for jimjeffers April 1, 2026 22:15
ksalamy added a commit that referenced this pull request Apr 7, 2026
…branches

Resolved conflict in DocCell.test.tsx by preserving:
- Our tests: secondary label, empty secondary, title attribute
- develop's test: long multi-word label regression (from PR #525)
ksalamy added a commit that referenced this pull request Apr 7, 2026
…n-feature conflicts

All conflicts were between develop's authoritative post-merge versions (PRs
#525, #526, #529, #531, #534, #535) and PR #530's older sync copies of the
same files. The actual #530 feature (ScheduleEventDetailsModal, ScheduleSection)
had no conflicts. Took --theirs for all 10 conflicted files.
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.

Update Documents Title for missions to display which one is currently deployed.

3 participants