Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@gdamore
Copy link
Owner

@gdamore gdamore commented Dec 15, 2025

Summary by CodeRabbit

  • Refactor

    • Internal screen implementation and naming reorganized; no changes to user-facing behavior or public API.
  • Bug Fix

    • Minor rendering attribute handling corrected to ensure consistent text decoration display.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 15, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Renamed the terminal screen module and class (dcell.ttyscreen → dcell.vt, TtyScreen → VtScreen), updated common.d to instantiate VtScreen, and fixed a symbol capitalization in a switch-case. The change updates imports/public names and preserves runtime behavior.

Changes

Cohort / File(s) Summary
Module and class rename + minor fix
source/dcell/vt.d
Module renamed from dcell.ttyscreendcell.vt; public class renamed TtyScreenVtScreen. Also corrected attr.doubleUnderlineAttr.doubleUnderline in a switch-case.
Updated screen instantiation
source/dcell/common.d
Updated import from dcell.ttyscreendcell.vt and changed newScreen() to instantiate VtScreen instead of TtyScreen.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Check source/dcell/vt.d for exported symbol name changes and correct module declaration.
  • Verify source/dcell/common.d import and instantiation updated.
  • Search the repo for other references to dcell.ttyscreen / TtyScreen and update as needed.
  • Confirm the capitalization fix (Attr.doubleUnderline) compiles and matches enum/type.

Possibly related PRs

Poem

I hopped through code with nimble feet, 🐇
Tty became Vt — a tidy feat,
Imports aligned and names set true,
Small fixes baked, the build flew too,
A carrot-coded cheer from me to you! 🎉

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 accurately summarizes the main change: renaming TtyScreen to VtScreen across the codebase, which is the primary focus of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 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 e4123f9 and f7e44d7.

📒 Files selected for processing (1)
  • source/dcell/vt.d (4 hunks)

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

Copy link
Contributor

@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

Caution

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

⚠️ Outside diff range comments (1)
source/dcell/vt.d (1)

709-717: Likely typo in underline case label: attr.doubleUnderline

In sendAttrs, the switch uses attr & Attr.underlineMask, but one case is case attr.doubleUnderline: instead of referencing the Attr enum. This is almost certainly meant to be Attr.doubleUnderline and otherwise looks like a compile-time or logic error.

Apply this minimal fix:

-        case attr.doubleUnderline:
+        case Attr.doubleUnderline:
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8437615 and e4123f9.

📒 Files selected for processing (2)
  • source/dcell/common.d (1 hunks)
  • source/dcell/vt.d (3 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: gdamore
Repo: gdamore/dcell PR: 27
File: source/dcell/ttyscreen.d:763-766
Timestamp: 2025-12-08T19:10:45.993Z
Learning: In source/dcell/ttyscreen.d, the newTtyScreen() factory function intentionally does not accept a term parameter because the TtyScreen constructor handles environment variable resolution internally with an optional term parameter. Users needing to override the terminal type should call the constructor directly: new TtyScreen(newDevTty(), "custom-term").
📚 Learning: 2025-12-08T19:10:45.993Z
Learnt from: gdamore
Repo: gdamore/dcell PR: 27
File: source/dcell/ttyscreen.d:763-766
Timestamp: 2025-12-08T19:10:45.993Z
Learning: In source/dcell/ttyscreen.d, the newTtyScreen() factory function intentionally does not accept a term parameter because the TtyScreen constructor handles environment variable resolution internally with an optional term parameter. Users needing to override the terminal type should call the constructor directly: new TtyScreen(newDevTty(), "custom-term").

Applied to files:

  • source/dcell/vt.d
  • source/dcell/common.d
📚 Learning: 2025-12-14T19:58:59.815Z
Learnt from: gdamore
Repo: gdamore/dcell PR: 53
File: source/dcell/ttyscreen.d:557-577
Timestamp: 2025-12-14T19:58:59.815Z
Learning: In source/dcell/ttyscreen.d, the TtyEventQ class intentionally has different behavior between put() and opOpAssign methods. The put() method calls ti.wakeUp() for external callers injecting synthetic events, while opOpAssign (used via ~= operator) bypasses wakeUp() as a performance optimization when appending events internally during tty event processing where the thread is already active.

Applied to files:

  • source/dcell/vt.d
📚 Learning: 2025-12-08T19:16:26.993Z
Learnt from: gdamore
Repo: gdamore/dcell PR: 27
File: source/dcell/ttyscreen.d:164-171
Timestamp: 2025-12-08T19:16:26.993Z
Learning: VT series terminals (vt100, vt102, vt220, vt320, vt420) are strictly monochrome. There are no color terminals with names like "vt220-color" in the VT series. The vt525 is mythical and would use "ansi" for $TERM if needed. Therefore, checking term.startsWith("vt") for monochrome classification is correct.

Applied to files:

  • source/dcell/vt.d
📚 Learning: 2025-12-08T19:17:33.678Z
Learnt from: gdamore
Repo: gdamore/dcell PR: 27
File: source/dcell/ttyscreen.d:448-494
Timestamp: 2025-12-08T19:17:33.678Z
Learning: In source/dcell/ttyscreen.d, Color.reset is defined as a value above the range of valid colors. In the sendColors() function, after emitting the reset sequence (vt.resetFgBg), Color.reset values naturally skip all subsequent color-setting logic (isRGB checks and palette range checks < 8, < 256) because they are out of range, which is the correct behavior by design.

Applied to files:

  • source/dcell/vt.d
  • source/dcell/common.d
🔇 Additional comments (1)
source/dcell/common.d (1)

14-14: Rename to VtScreen is correctly wired in the common factory

The import and newScreen() factory now target VtScreen while preserving the Screen return type and the existing /dev/tty + $TERM behavior in the constructor, so callers using the abstract Screen API should see no behavioral change. Based on learnings, this keeps the environment/TTY resolution semantics in the screen implementation rather than in the factory.

Also applies to: 22-22

@gdamore gdamore merged commit f7e44d7 into main Dec 15, 2025
4 of 5 checks passed
@gdamore gdamore deleted the vt branch December 15, 2025 05:13
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.

2 participants