Skip to content

Conversation

@Valley-15
Copy link

@Valley-15 Valley-15 commented Jan 26, 2026

Problem

Table management controls (adding/deleting rows and columns) were missing from the UI editor.

Changes

  • Implemented a context-aware BubbleMenu for tables in WikiBubbleMenu.vue.
  • Added UI actions for row/column manipulation and table deletion.
  • Added a 10px vertical offset to the menu positioning to ensure it does not overlap cell content.

Preview

Screenshot 2026-01-26 141135

Fixes #480

Summary by CodeRabbit

  • New Features

    • Added a dedicated table manipulation menu (add/delete rows/columns, delete table) that appears only when editing tables.
    • Separated general editing menu from table-specific menu so the main menu shows only in appropriate contexts.
    • New icons added for formatting and table actions.
  • Style

    • Minor layout, spacing, and hover/active adjustments for the two-menu layout.
    • Page content container updated to use a full-width inner wrapper, changing centering behavior.

@coderabbitai
Copy link

coderabbitai bot commented Jan 26, 2026

Walkthrough

The tiptap bubble menu component was restructured: an outer wrapper now contains two BubbleMenu instances—the original controlled by shouldShowBubbleMenu and a table-specific menu controlled by shouldShowTableMenu. An isInsideTable helper and table actions (add/delete rows/columns, delete table) were added and wired to new lucide-vue-next icons (Trash2, TableRowsSplit, TableColumnsSplit). toggleLink was routed through the existing editor command path. Minor CSS adjustments were made for the two-menu layout. The wiki layout template changed to wrap main content in a full-width inner div instead of centering via flex.

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive Template layout changes in wiki/layout.html appear incidental to core table control restoration; clarification needed on whether this DOM restructuring is directly required for the table menu fix. Confirm whether the wiki/layout.html changes are essential to the table control restoration or if they address a separate concern related to menu positioning.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly references the main objective (restoring table controls and improving popup positioning) and links to the relevant issue #480, directly matching the PR's core changes.
Linked Issues check ✅ Passed The PR implements context-aware table menu with row/column manipulation actions, adds table deletion UI, and includes 10px vertical offset for menu positioning, fully addressing issue #480 requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
frontend/src/components/tiptap-extensions/WikiBubbleMenu.vue (1)

160-187: Delete row, delete column, and delete table buttons use the same Trash2 icon — consider differentiating.

Lines 167 and 179 both render <Trash2 :size="16" class="text-red-500" />, making them visually indistinguishable. Users must rely on hover tooltips or button position to tell "Delete Row" from "Delete Column." Line 185 uses text-red-700 for "Delete Table," which is a subtle shade difference.

Consider using distinct icons (e.g., a row-specific and column-specific delete icon) or adding short text labels alongside the icons to improve discoverability.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Valley-15
Copy link
Author

Hi @NagariaHussain, I’m following up on this PR. It restores the missing table manipulation controls and fixes the menu positioning as described in issue #480. All automated checks and CodeRabbit validations have passed. Could you please take a look when you have a moment? Thanks!

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/src/components/tiptap-extensions/WikiBubbleMenu.vue (1)

199-209: ⚠️ Potential issue | 🟠 Major

Both bubble menus will appear simultaneously when text is selected inside a table.

shouldShowBubbleMenu doesn't exclude the table context, so selecting text within a table cell will trigger both the formatting menu and the table menu at the same time, likely overlapping each other.

Add a table check to shouldShowBubbleMenu:

Proposed fix
 function shouldShowBubbleMenu({ editor, state }) {
 	const selection = state.selection;
 
 	// Bubble menu is only for inline text formatting, not media/node selections.
 	if (selection instanceof NodeSelection) return false;
 	if (selection.empty) return false;
 	if (editor.isActive('videoBlock')) return false;
 	if (editor.isActive('image')) return false;
+	if (editor.isActive('table')) return false;
 
 	return true;
 }

Alternatively, if formatting inside tables should still be possible, consider a toggle or a combined menu approach so both don't render independently.

🧹 Nitpick comments (3)
frontend/src/components/tiptap-extensions/WikiBubbleMenu.vue (3)

131-135: Table menu's tippy-options is missing preventOverflow and flip modifiers.

The primary bubble menu (line 7–28) includes preventOverflow and flip popper modifiers to keep it within the viewport. The table menu omits these, so it can be clipped or hidden when the table is near the edge of the viewport.

Proposed fix
       :tippy-options="{ duration: 100, zIndex: 50, offset: [0, 10] }"
+      <!-- Consider matching the primary menu's popperOptions:
+           popperOptions: {
+             modifiers: [
+               { name: 'preventOverflow', options: { boundary: 'viewport', padding: 8 } },
+               { name: 'flip', options: { fallbackPlacements: ['top', 'bottom', 'right'] } }
+             ]
+           }
+      -->

A cleaner approach — extract the shared tippy config into a computed/const and reuse it:

const sharedTippyOptions = {
  duration: 100,
  zIndex: 50,
  popperOptions: {
    modifiers: [
      { name: 'preventOverflow', options: { boundary: 'viewport', padding: 8 } },
      { name: 'flip', options: { fallbackPlacements: ['top', 'bottom', 'right'] } },
    ],
  },
};

Then for the table menu, spread and add the offset: { ...sharedTippyOptions, offset: [0, 10] }.


139-165: Hardcoded hex colors bypass the design system.

The Trash2 icons use inline color="#ef4444" and color="#b91c1c", while every other color in this component uses CSS custom properties (e.g., var(--ink-gray-6, #4b5563)). This will not respond to theme changes and is inconsistent.

Consider using a CSS class instead:

Proposed fix
-          <Trash2 :size="16" color="#ef4444" />
+          <Trash2 :size="16" class="text-red-500" />
-          <Trash2 :size="16" color="#b91c1c" />
+          <Trash2 :size="16" class="text-red-700" />

Or define a CSS custom property for destructive actions and use it here.


139-143: Replace icon rotation with purpose-built table operation icons.

The current icons fail to provide clear visual differentiation: PlusSquare is symmetric (180° rotation is visually identical), and Columns rotated 90° is unconventional. lucide-vue-next provides dedicated icons specifically designed for table operations:

  • Replace rotated PlusSquare icons with TableRowsSplit for row insert operations
  • Replace rotated Columns icons with TableColumnsSplit for column insert operations

This improves icon clarity and makes actions more discoverable without relying on rotation or unconventional transformations.

@Valley-15 Valley-15 force-pushed the fix/table-row-deletion-480 branch from 76b329a to 6ff741a Compare February 10, 2026 09:12
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@wiki/templates/wiki/layout.html`:
- Around line 55-60: Fix the inconsistent indentation inside the template by
aligning the inner <div> and the closing </main> with the opening <main> tag and
surrounding context; update the block body lines inside the <main> (the {% block
body %}{% endblock %}) so they use the same indentation level as <main>’s
children (i.e., match the existing 8-space indentation), ensuring <main
class="...">, its child <div>, the block body, and the closing </main> are
consistently indented.
🧹 Nitpick comments (2)
frontend/src/components/tiptap-extensions/WikiBubbleMenu.vue (2)

139-165: Three identical trash icons may confuse users.

The delete row (Line 146), delete column (Line 158), and delete table (Line 164) buttons all use Trash2 with only a slight color difference (text-red-500 vs text-red-700). The visual distinction is minimal. Consider using more descriptive icons or adding text labels to improve discoverability. The "Add Row Above" icon (rotated TableRowsSplit) may also not be immediately intuitive.


131-167: Table BubbleMenu — consider adding preventOverflow like the main menu.

The main BubbleMenu (Line 7-28) has preventOverflow and flip popper modifiers to keep it within the viewport, but the table BubbleMenu (Line 135) only sets offset: [0, 10]. For tables near viewport edges, the table menu could get clipped.

♻️ Suggested tippy-options for the table menu
-      :tippy-options="{ duration: 100, zIndex: 50, offset: [0, 10] }"
+      :tippy-options="{
+        duration: 100,
+        zIndex: 50,
+        offset: [0, 10],
+        popperOptions: {
+          modifiers: [
+            {
+              name: 'preventOverflow',
+              options: {
+                boundary: 'viewport',
+                padding: 8,
+              },
+            },
+            {
+              name: 'flip',
+              options: {
+                fallbackPlacements: ['top', 'bottom'],
+              },
+            },
+          ],
+        },
+      }"

@Valley-15 Valley-15 force-pushed the fix/table-row-deletion-480 branch from 871fb1d to 25ba25a Compare February 10, 2026 09:28
@Valley-15
Copy link
Author

@NagariaHussain, I’ve addressed all the feedback. You can see everything working perfectly in the attached recording.

Updates:

Fixed Menu Overlap: Added a robust crawler to suppress the formatting menu inside tables.

Icon Polish: Switched to cohesive TableRowsSplit and TableColumnsSplit icons (with mirroring for columns).

Design System: Swapped hardcoded hex colors for standard CSS classes.

Stability: Added preventOverflow and flip to the table menu.

Layout: Cleaned up indentation and structure in layout.html.

Conflicts are resolved and the branch is synced with develop
could you review it once?

0a7.mp4

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.

Removing a row from a table doesnt work anymore

1 participant