Skip to content

[Bug] fix(reader): Delete annotation button never appears in selection popup #401

Description

@GeraldCox

What went wrong?

The selection popup has a delete (trash) button that is conditionally rendered with v-if="overlappingAnnotationId !== null", but overlappingAnnotationId is never set to a real value. The deletion handler in ReaderView.vue (handleDeleteAnnotation) is fully implemented and correct — it's just unreachable.

Steps to reproduce

  1. Open any book and highlight some text
  2. Re-select that highlighted text

Expected vs actual behavior

Expected behavior:
The trash icon appears in the popup, allowing the user to delete the highlight without going to the sidebar.

Actual behavior:
The delete button never appears.

Root cause:
In client/src/features/reader/epub/composables/useReaderSelection.ts (line 19), overlappingAnnotationId is hardcoded to null every time show() is called. No code in the selection flow or in ReaderView.vue detects whether the current selection overlaps an existing annotation and sets this value.

Your setup

  • BookOrbit version/image tag: latest
  • Deployment: Docker / Unraid
  • OS: Unraid
  • Browser: Edge (latest)

Relevant logs (optional)

Screenshots (optional)

No response

Before submitting

  • I've searched existing issues and this hasn't been reported yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleasedIssue or PR is included in a released version.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions