Skip to content

Commit

Permalink
fixes for smart notes, default annotation color and some small style …
Browse files Browse the repository at this point in the history
…stuff
  • Loading branch information
blackforestboi committed Feb 26, 2024
1 parent 5d737bf commit ecc08c5
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion external/@worldbrain/memex-common
8 changes: 5 additions & 3 deletions src/annotations/components/AnnotationEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,25 @@ class AnnotationEdit extends React.Component<Props> {

async componentDidMount() {
await this.youtubeKeyboardShortcut()
this.editorRef?.setEditable(this.props?.isEditMode ?? false)
this.editorRef?.setEditable(this.props?.isEditMode)

if (!this.editorRef?.checkIfHasContent() && !this.props.isEditMode) {
this.setState({ shouldShowEditor: false })
} else if (this.props.isEditMode) {
this.setState({ shouldShowEditor: true })
}
}

componentDidUpdate(prevProps: Props) {
if (prevProps.isEditMode !== this.props.isEditMode) {
this.editorRef?.setEditable(this.props?.isEditMode ?? false)
this.editorRef?.setEditable(this.props?.isEditMode)

if (
!this.editorRef?.checkIfHasContent() &&
!this.props.isEditMode
) {
this.setState({ shouldShowEditor: false })
} else {
} else if (this.props.isEditMode) {
this.setState({ shouldShowEditor: true })
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/content-scripts/content_script/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,11 +671,16 @@ export async function main(
shouldCopyShareLink: boolean,
showSpacePicker?: boolean,
commentText?: string,
highlightColorSetting?: HighlightColor,
) => {
if (!(await pageActionAllowed(analyticsBG))) {
return
}

const highlightColorSettingStorage = await getHighlightColorSettings()
const highlightColor =
highlightColorSetting ?? highlightColorSettingStorage[0]

let screenshotGrabResult
if (
isPdfViewerRunning &&
Expand Down Expand Up @@ -704,6 +709,7 @@ export async function main(
screenshotGrabResult.anchor,
screenshotGrabResult.screenshot,
imageSupportBG,
highlightColor,
)

const annotationId = result.annotationId
Expand All @@ -729,6 +735,10 @@ export async function main(
const result = await saveHighlight(
shouldShare,
shouldCopyShareLink,
null,
null,
imageSupportBG,
highlightColor,
)

const annotationId = result.annotationId
Expand Down
1 change: 1 addition & 0 deletions src/dashboard-refactor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2003,6 +2003,7 @@ const Container = styled.div<{
fullSizeInPage: boolean
}>`
display: flex;
position: relative;
flex-direction: column;
width: fill-available;
background-color: ${(props) =>
Expand Down
2 changes: 1 addition & 1 deletion src/overview/help-btn/components/help-btn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ const HelpIconPosition = styled.div`
justify-content: space-between;
height: fit-content;
width: fit-content;
position: fixed;
position: absolute;
bottom: 10px;
right: 10px;
z-index: 100;
Expand Down
2 changes: 1 addition & 1 deletion src/sidebar/annotations-sidebar/containers/logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4655,7 +4655,7 @@ export class SidebarContainerLogic extends UILogic<
let prompt = event.prompt ?? 'Summarise this concisely and briefly'

await this.queryAI(
undefined,
this.fullPageUrl,
combinedText,
prompt,
previousState,
Expand Down

0 comments on commit ecc08c5

Please sign in to comment.