Skip to content

Fix: CodeViewer scroll handler crash - #63

Merged
MathCunha16 merged 1 commit into
mainfrom
fix/code-viewer-scroll-event-null
Sep 6, 2026
Merged

MathCunha16 merged 1 commit into
mainfrom
fix/code-viewer-scroll-event-null

Conversation

@MathCunha16

@MathCunha16 MathCunha16 commented Sep 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fix the CodeViewer scroll handler crash that occurred when opening or scrolling large snippets. The handler now captures scrollTop synchronously before updating React state, preventing access to a nullified currentTarget.

This PR also bumps the application version to 0.2.1-beta.

Related issue

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor or maintenance
  • Documentation
  • Other (describe below)

How was this tested?

  • Ran npm run build in frontend/.
  • Opened the Devaulty snippets view with a large multiline shell command.
  • Scrolled through the snippet content to validate that the viewer no longer crashes.
  • Confirmed that the AppImage/backend process validation command remains readable and usable.

Checklist

  • I have read CONTRIBUTING.md.
  • The change is focused and does not include unrelated refactors.
  • I added or updated documentation when needed.
  • I added or updated tests when the behavior requires it.
  • I ran the relevant existing checks locally.
  • I did not include secrets, credentials, personal data, or generated build artifacts.
  • I understand the code I am submitting and reviewed all AI-assisted output, if any.
  • I disclosed significant AI assistance that affected the design or implementation, if applicable.

Screenshots or recordings

Not applicable. This is a behavior fix without a visual UI change

Summary by CodeRabbit

  • Atualização

    • A versão da aplicação foi atualizada para v0.2.1-beta em todos os componentes distribuídos.
    • A identificação da versão agora aparece de forma consistente entre a aplicação e seus pacotes.
  • Melhorias

    • O comportamento de rolagem do visualizador de código foi reorganizado internamente, sem alteração perceptível na experiência de uso.

…1-beta

Capture scrollTop synchronously before updating the React state to avoid
accessing a nullified currentTarget while rendering large snippets
@MathCunha16 MathCunha16 self-assigned this Sep 6, 2026
@MathCunha16 MathCunha16 added the Frontend Frontend feature or modification label Sep 6, 2026
@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Essentials

Run ID: 74769201-fb62-4cd3-8194-885939b112c3

📥 Commits

Reviewing files that changed from the base of the PR and between accb784 and ba13198.

⛔ Files ignored due to path filters (1)
  • frontend/src-tauri/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • backend/internal/domain/model/version.go
  • frontend/package.json
  • frontend/src-tauri/Cargo.toml
  • frontend/src-tauri/tauri.conf.json
  • frontend/src/components/CodeViewer.tsx

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

A versão foi atualizada para 0.2.1-beta no backend, frontend e aplicação Tauri. O manipulador de rolagem do CodeViewer foi reestruturado sem alteração de comportamento.

Changes

Alinhamento de versões

Layer / File(s) Summary
Declarações de versão
backend/internal/domain/model/version.go, frontend/package.json, frontend/src-tauri/Cargo.toml, frontend/src-tauri/tauri.conf.json
As versões do backend, frontend e aplicação Tauri foram atualizadas de 0.2.0-beta para 0.2.1-beta.

Manipulador de rolagem do CodeViewer

Layer / File(s) Summary
Atualização do manipulador de rolagem
frontend/src/components/CodeViewer.tsx
O manipulador onScroll armazena scrollTop na variável local top antes de atualizar scrollState.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to ba131

The update prevents the CodeViewer scroll crash and aligns the application version across components. No remaining merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed O título identifica de forma clara e concisa a principal alteração: a correção do crash no manipulador de rolagem de CodeViewer.
Description check ✅ Passed A descrição cobre o resumo, o tipo de mudança, os testes realizados, o checklist e a ausência de alterações visuais. O campo Closes # não contém um número de issue, e alguns itens opcionais do check…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@MathCunha16
MathCunha16 merged commit 6e6054b into main Sep 6, 2026
2 checks passed
@MathCunha16
MathCunha16 deleted the fix/code-viewer-scroll-event-null branch September 6, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend Frontend feature or modification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant