zotero/scss/elements/_annotationRow.scss
abaevbog 48fd23ccec
annotations showing in itemTree (#3416)
- Annotations are displayed in itemTree under their file attachments
  on a third level. The annotation spans the entire row.
- The title is constructed on the go. When possible, it
  includes annotation quote and comment as pseudo-columns
  of the row. The comment occupies about twice as much space as
  the quote. Otherwise, (if there is no quote) only the annotation
  comment
  is included as the "title" part of the row
- Non-CJK segments of the quote part of the annotation row are
  italicized. CJK segments are left as is. If CJK segments are present,
  there is more padding between quote and comment parts.
- Search matches the actual attachment instead of its parent file.
- Can create child notes from annotations of the same item or
  standalone notes from annotations across different items from
  the context menu or the header button.
- When an annotation (or multiple annotations) are selected, the
  annotationItemPane component is displayed where annotations are
  grouped by their top-level item. Annotations are displayed fully,
  without having their content cut off.
- Special treatment for annotations to always prompt
  to erase the item regardless of what collectionTree row
  is selected (e.g., if a collection is selected, we
  still want one to be able to delete the annotation).
  This only applies if all selected items are annotations.
  If multiple items are selected, some annotations and
  some not, do nothing. This is until the trash is
  ready. In the future, we may send annotations to trash
- strip all HTML tags from annotation for now, until the logic to
  properly render annotation markup is copied over from the reader
  (applies to both annotation-row component and the annotation
  item rendered in the itemTree)
- Added a generalized "expandToItem" function to itemTree to
  expand all ancestors of a given item, similar to "expandToCollection"
  from collectionTree
- add annotation conditions to advanced search
- show [Image not available] if no annotation file for ink or image
  annotations
- only keep annotation-specific context menu options when some
  annotations are selected in itemTree
- enable Quick Copy of annotations from itemTree via drag-drop,
  shortcut key, or Edit → Copy Annotation
- Minor refactoring of Zotero.Annotation.toJSON() to pull out async code
  that handles ink and image annotations, so that
  Zotero.Annotation.toJSONsync() for highlight, underline, and note
  annotations does not have to be awaited. Since ink and image
  annotation don't seem to work for drag-drop Quick Copy, they are just
  skipped for now.
2025-04-28 04:10:28 -04:00

70 lines
1.2 KiB
SCSS

annotation-row {
display: flex;
flex-direction: column;
border-radius: 5px;
border: 1px solid var(--color-quinary-on-sidepane);
background: var(--material-background);
@include focus-ring;
.head {
display: flex;
padding: 4px 8px;
align-items: center;
gap: 4px;
border-bottom: 1px solid var(--fill-quinary);
.icon {
width: 16px;
height: 16px;
-moz-context-properties: fill;
fill: var(--annotation-color, var(--fill-secondary));
}
.title {
font-weight: 600;
}
}
.body {
img {
max-width: 100%;
@media (prefers-color-scheme: dark) {
filter: brightness(80%);
}
}
.quote, .comment {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 9;
overflow: hidden;
overflow-wrap: anywhere;
}
.quote {
margin: 3px 8px;
padding-inline-start: 6px;
border-inline-start: 2px solid var(--annotation-color, var(--fill-secondary));
color: var(--fill-secondary);
@include comfortable {
margin-block: 5px;
}
}
.comment {
padding: 3px 8px;
@include comfortable {
margin-block: 4px;
}
}
}
.tags {
border-top: 1px solid var(--fill-quinary);
padding: 3px 8px;
word-break: break-word;
}
}