[Feat]: Notebooks: duplicate a cell to the end of the notebook

Open
#1,512 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
react, typescript

Research direction

Start with packages/web-ui/src/utils/notebook.ts and the add-cell flow in NotebookView.tsx; then trace how NotebookCellHeader.tsx actions reach the view. Extend the notebook utility and existing tests in packages/web-ui/tests/utils/notebook.test.ts and NotebookView.test.tsx. Done means SQL and Markdown cells append as independent copies with fresh ids and cleared runtime state, without shifting existing cells or executing SQL; undo and redo should cover the edit.

Written by the indexing model from the issue text.

Description

feature request good first issue
Prerequisites
  • I have written a descriptive issue title.
  • I have searched existing issues and open pull requests to avoid duplicating an existing feature request.
🚀 Feature Proposal

Add Duplicate to end for SQL and Markdown cells, appending a document-only copy with a fresh cell id. Appending is intentional: this first milestone must not shift existing positional cell references.

Motivation

Users often want to try a variation of a query while keeping the original and its output.

Example
Choose Duplicate to end on the second SQL cell. A source/configuration copy appears as the final cell with no output; all pre-existing cell positions remain unchanged.
Acceptance criteria
  • Append a new cell with a fresh id, same type/content/name/schema and a deep copy of chart/display configuration. Start Markdown copies in edit mode and keep the new cell body expanded.
  • Clear result, error, execution time, loading state and per-cell execution history; do not share mutable configuration objects between original and copy.
  • Preserve source references verbatim and leave existing cells and their positions unchanged. If stable aliases are introduced, do not copy a unique result alias.
  • Scroll to and focus the new cell using the existing add-cell flow; duplication must not execute SQL.
  • Use the existing updateNotebook path so the operation is a single undoable structural edit and persists normally. Disable duplication while notebook execution is active.
  • Test SQL/Markdown copies, source with cell references, fresh ids, configuration independence, cleared runtime fields and undo/redo.
Where to start

Verified against main at 066e41c34001edbc6c869ed726aa3958d3ae7db5: notebook.ts provides create/add/remove/move helpers but no duplication helper; NotebookCellHeader has no duplicate action. Existing {{cell_N}} references are position-based.

Existing test references:

Scope: Append-only duplication of one cell; adjacent insertion, reference rewriting and whole-notebook duplication are outside this milestone.

Plugin behavior: Pure document editing; no database calls or driver-specific logic.

Good first issue scope: A pure copy helper and header-to-view callback wiring, using existing insertion and undo infrastructure. Append-only placement avoids a reference migration.

Contributor notes
  • Follow AGENTS.md and the repository rules. Run upstream GitNexus impact analysis before editing existing symbols and report the blast radius; run change detection before committing.
  • Add new UI strings to every locale under packages/web-ui/src/i18n/locales/. Use design tokens, keyboard access, accessible labels and visible focus.
  • Keep pure frontend helpers under packages/web-ui/src/utils/ and tests under matching packages/web-ui/tests/ paths. Run focused tests, pnpm typecheck, pnpm lint and pnpm build; extend existing notebook tests for the behaviors above.
  • Preserve desktop and web behavior. Any necessary shared backend logic belongs in src-tauri/src/application/ or plain modules, with transport-specific code in the corresponding transport module. For backend changes, run relevant Rust tests and cargo check --no-default-features from src-tauri/.
  • Questions? Ask here or on Discord.
Dominant language
TypeScript
Stars
5.1k
Forks
335
Avg merge
1d 19h
Merged PRs (30d)
240

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TabularisDB/tabularis

All issues in TabularisDB/tabularis

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.