Skip to content

Eliminate date-node-viewer onTitleChange callback effect #694

Closed

Description

@malibio

Overview

Remove the $effect in date-node-viewer.svelte that notifies parent of title changes. Instead, have the parent derive the title directly.

Problem Statement

Current implementation uses $effect to notify parent when title changes:

// date-node-viewer.svelte line 61
$effect(() => {
  onTitleChange?.(tabTitle);
});

This is the "effect as event handler" anti-pattern. The parent should derive the title from the nodeId rather than waiting for a callback from the child.

Proposed Solution

Option 1 (Preferred): Parent derives title directly

// In parent component
const title = $derived(getDateTabTitle(parseDateFromNodeId(nodeId)));

Option 2: Use onMount for initial notification only

onMount(() => {
  onTitleChange?.(tabTitle);
});

Files to Modify

  • date-node-viewer.svelte: Remove $effect, potentially remove onTitleChange prop
  • Parent component (pane-content.svelte or similar): Derive title from nodeId

Acceptance Criteria

  • $effect eliminated from date-node-viewer.svelte
  • Tab title still displays correctly for date nodes
  • Title updates when navigating between date nodes
  • Tests pass (bun run test:all)
  • Quality checks pass (bun run quality:fix)

Related Issues

Activity

  1. self-assigned this
    on Nov 30, 2025
  2. malibio commented on Nov 30, 2025

    @malibio
    CollaboratorAuthor

    Test baseline: Frontend 1469 passed, Rust 531 passed

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions