Skip to content

Flash revealed editor tabs for terminal file links - #35656

Merged
AmethystLiang merged 1 commit into
mainfrom
add-animation-for-opening-doc
Oct 29, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
add-animation-for-opening-doc

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​44 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​44
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​108 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​107

Problem

Opening a terminal file link that points to an already-visible editor tab gave no visual confirmation that the click worked.

Solution

Briefly tint the revealed editor tab, including when it is already active. Repeat clicks restart the tint so each click gets feedback.

ELI5

A file link now makes the editor gently flash, so it is clear where the file opened.

What Changed

  • Added a per-editor reveal-flash store and overlay animation.
  • Triggered the flash after a terminal file link reveals an editor view.
  • Added tests for targeting, clearing, and repeated flashes.

Why

An existing active tab otherwise looks unchanged after a file-link click. A short, scoped visual cue confirms the action without moving focus or changing the document.

Linked Issue

Fixes #

Visual Proof

TODO: attach before/after visual proof for this UI behavior change.

Testing

  • Added automated coverage for editor reveal-flash targeting, timeout cleanup, and repeat-click animation restarts.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Considered security, cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, backwards compatibility, and performance. The animation is renderer-only, scoped per editor view, and does not change file-opening behavior.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] The change affects visual feedback for terminal file links in the editor.

The PR appears safe to merge, with a non-blocking request to test visible repeat-click feedback.

Findings

  1. P2 Visible restarts remain untested ▶

Summary

Terminal file links now briefly tint the editor they reveal, including an already-active editor.

  • Terminal file links briefly tint the editor view they reveal.

Reviews (1) · Last reviewed commit: "Flash revealed editor tabs when opening ..." · Reviewed by Greptile

Comment on lines +29 to +37
it('restarts with a new key and a fresh timer on a repeat flash', () => {
vi.useFakeTimers()
const { result } = renderHook(() => useEditorRevealFlashKey('view-c'))

act(() => flashRevealedEditorView('view-c'))
const firstKey = result.current
act(() => vi.advanceTimersByTime(EDITOR_REVEAL_FLASH_MS - 100))
act(() => flashRevealedEditorView('view-c'))
expect(result.current).not.toBe(firstKey)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Visible restarts remain untested

The repeat-click test checks only that the hook returns a new number. It never renders EditorRevealFlash, so removing key={flashKey} would leave this test passing while repeated clicks stop restarting the visible animation. Add a component test that flashes twice, checks that the second flash replaces the first DOM node, and checks that the overlay disappears after the timer.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

Opening a linked file now flashes its editor view, including when the link has no line position. Each view has a separate flash key that clears after 1.2 seconds; a repeated flash restarts its timer. The active editor renders an aria-hidden overlay while its flash is active. The overlay uses the locate color and fades out.

Priority: Low

Merge Risk: Minimal · up to 9f77f

No merge-blocking issue is established. A component test would better protect repeated-flash behavior.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description explains the problem, solution, user impact, implementation, and tests, but it is incomplete for the repository template. The required linked issue is empty, visual proof is marked TOD… Add a valid issue reference after “Fixes #”. Attach before-and-after screenshots or a video, or write N/A with a valid reason if no visual proof is possible. Report manual testing and the results of lint, typecheck, test, and build, or stat…
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: flashing editor tabs revealed by terminal file links.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the problem, solution, user impact, implementation, and tests, but it is incomplete for the repository template. The required linked issue is empty, visual proof is marked TODO for a UI change, and testing and validation checklist items remain unchecked.

Resolution

Add a valid issue reference after “Fixes #”. Attach before-and-after screenshots or a video, or write N/A with a valid reason if no visual proof is possible. Report manual testing and the results of lint, typecheck, test, and build, or state that CI will cover each check. Complete the remaining checklist items after review.

Full details: Docstring Coverage

Explanation

Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 5 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick comments: 1
src/renderer/src/components/tab-group/editor-reveal-flash.test.ts: 1

29-43: Trivial · Maintainability & Code Quality · Quick win

Add a component-level test for the repeated-flash remount.

The new tests call only useEditorRevealFlashKey. They never render EditorRevealFlash, so nothing checks that the rendered <span> remounts when the key changes. If key={flashKey} is removed, the hook tests still pass. The span then stays mounted during a repeat reveal, and the editor-reveal-flash CSS animation does not restart. That is the behavior the PR describes for repeated clicks.

A rendering test should check DOM identity across a repeat flash:

Suggested fix
// @vitest-environment happy-dom
// New file: src/renderer/src/components/tab-group/EditorRevealFlash.test.tsx
import { act, render } from '@testing-library/react'
import { afterEach, describe, expect, it, vi } from 'vitest'
import { EditorRevealFlash } from './EditorRevealFlash'
import { EDITOR_REVEAL_FLASH_MS, flashRevealedEditorView } from './editor-reveal-flash'

describe('EditorRevealFlash', () => {
  afterEach(() => {
    vi.useRealTimers()
  })

  it('remounts the flash span on a repeat flash', () => {
    vi.useFakeTimers()
    const { container } = render(<EditorRevealFlash viewStateId="view-d" />)

    act(() => flashRevealedEditorView('view-d'))
    const first = container.querySelector('.editor-reveal-flash')
    expect(first).not.toBeNull()

    act(() => vi.advanceTimersByTime(EDITOR_REVEAL_FLASH_MS - 100))
    act(() => flashRevealedEditorView('view-d'))
    expect(container.querySelector('.editor-reveal-flash')).not.toBe(first)
  })
})

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 94ef1487-0872-4a7b-83be-0cf922b381d7
Commits

Reviewing files that changed from the base of the PR and between 2dd9c82 and 9f77f28.

Files selected for processing: 6
  • src/renderer/src/assets/main.css
  • src/renderer/src/components/tab-group/EditorRevealFlash.tsx
  • src/renderer/src/components/tab-group/TabGroupPanel.tsx
  • src/renderer/src/components/tab-group/editor-reveal-flash.test.ts
  • src/renderer/src/components/tab-group/editor-reveal-flash.ts
  • src/renderer/src/components/terminal-pane/terminal-file-link-editor-open.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@AmethystLiang
AmethystLiang merged commit 61e018f into main Oct 29, 2026
46 checks passed
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.

1 participant