Skip to content

Conversation

@mkh-user
Copy link
Member

@mkh-user mkh-user commented Oct 14, 2025

Type of Change

  • New feature
  • UI/UX improvement

Description

When value of editor vertical scroll bar changes, updates value of preview vertical scroll bar with this new scroll value, users still can scroll to specific point with preview vertical scroll bar.

Testing

Works fine

Impact

Nothing

Additional Information

Nothing

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings
  • Changes were added to CHANGELOG

Summary by CodeRabbit

  • New Features

    • Added vertical scrolling to the preview panel with independent scroll regions.
    • Added dedicated scrollbars for both the main preview and the node preview.
    • Synchronized preview scrolling with the editor’s vertical scroll for consistent navigation.
  • Improvements

    • Updated preview layout for better spacing and readability.
    • Improved navigation for large previews with smoother, coordinated scrolling behavior.

@mkh-user mkh-user self-assigned this Oct 14, 2025
@mkh-user mkh-user moved this from Needs Review to In Progress in Release: Text Forge 1.0 Oct 14, 2025
@mkh-user mkh-user added this to the Text Forge 0.2 milestone Oct 14, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

Walkthrough

Replaces the node preview container with a MarginContainer, adds a ScrollContainer and VScrollBar references for both previews, exposes a preview_scroll_container node path, and connects the global editor VScrollBar to a new _update_scroll handler to synchronize vertical scrolling.

Changes

Cohort / File(s) Summary
Preview panel script updates
data/panels/preview/panel.gd
Changed exported type of preview_node to MarginContainer; added exported preview_scroll_container: ScrollContainer; added onready VScrollBar refs for preview, node preview, and global editor; connected editor VScrollBar value_changed to new func _update_scroll(value: float) which scales/sets values on both preview scroll bars; preserved existing _update_preview logic.
Scene wiring for scroll container
data/panels/preview/panel.tscn
Added preview_scroll_container node path (e.g. Margin/TabContainer/ScrollContainer) and updated node_paths to include this reference for script exports.
Changelog
CHANGELOG.md
Added Unreleased entry documenting synchronization of preview scrolling with the editor VScrollBar.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Editor as Editor VScrollBar
  participant Panel as PreviewPanel (panel.gd)
  participant Prev as Main Preview VScrollBar
  participant NodePrev as Node Preview VScrollBar

  User->>Editor: scroll (value_changed)
  Editor-->>Panel: value_changed(value)
  activate Panel
  Note over Panel: _update_scroll(value)\n(scale if needed)
  Panel->>Prev: set_value(scaled value)
  Panel->>NodePrev: set_value(scaled value)
  deactivate Panel
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

I hop through panes where pixels flow,
Two bars align, a gentle tow —
The editor nudges, previews glide,
Synchronized paths where outputs bide.
A carrot cheer for tidy scroll,
My whiskers twitch — the panels whole. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and accurately summarizes the primary change—synchronizing the editor’s vertical scroll with the preview pane—and uses precise, descriptive language that makes the feature immediately understandable to anyone reviewing the commit history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch synced-preview-scroll

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e211b2c and 5572ed8.

📒 Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md

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.

coderabbitai[bot]

This comment was marked as resolved.

@mkh-user mkh-user merged commit 31a5770 into Main Oct 14, 2025
2 checks passed
@mkh-user mkh-user deleted the synced-preview-scroll branch October 14, 2025 14:05
@github-project-automation github-project-automation bot moved this from In Progress to Completed in Release: Text Forge 1.0 Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

2 participants