-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(annotation): Allow comments to target text selections (#280)
* Fixed if condition in order to explicitly check whether the engine passed is None * Added new alembic revision * Added support for comments targeting selected text * Handling comments that target part of a line in the GUI * Improved selection precision and whenever a selection overlaps with a comment that points to it said comment will be edited * Added dummyview implementation to test services * Further improved text fixtures * Added more relevant tests * Modified comment ordering logic * Revised tests * Eliminated TODO item * Update bookworm/annotation/__init__.py Co-authored-by: Rowen <manchen_0528@outlook.com> * Overlapping issues will be reported before the user can be prompted to insert a new note * Fixed import error * Fixed import Error * Cleaned up dead code --------- Co-authored-by: cary-rowen <manchen_0528@outlook.com>
- Loading branch information
1 parent
030b923
commit 6ca423c
Showing
9 changed files
with
291 additions
and
19 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
alembic/versions/35f453946f1e_added_start_and_end_pos_to_note.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""Added start and end pos to Note | ||
Revision ID: 35f453946f1e | ||
Revises: 85028f013e6d | ||
Create Date: 2024-12-01 11:46:44.985313 | ||
""" | ||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
import bookworm | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = '35f453946f1e' | ||
down_revision: Union[str, None] = '85028f013e6d' | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column('note', sa.Column('start_pos', sa.Integer(), nullable=True)) | ||
op.add_column('note', sa.Column('end_pos', sa.Integer(), nullable=True)) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column('note', 'end_pos') | ||
op.drop_column('note', 'start_pos') | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.