Skip to content

Commit b312a10

Browse files
Bug bashing (#293)
#293 * fixed image upload CDN option; Signed-off-by: Sahil Shubham <[email protected]> * same background as extension for iframe rendered actions; Signed-off-by: Sahil Shubham <[email protected]> * added new comment shortcut; Signed-off-by: Sahil Shubham <[email protected]> * updated no shared notes message; Signed-off-by: Sahil Shubham <[email protected]> * get todo status and priority from content for public view; Signed-off-by: Sahil Shubham <[email protected]> * re-added type in shared lib; fixed type conflict; fixed build; Signed-off-by: Sahil Shubham <[email protected]> * added build github action to checkout pull requests; Signed-off-by: Sahil Shubham <[email protected]> * fixed quick note reference ID; Signed-off-by: Sahil Shubham <[email protected]> * some fixes towards extension sidebar font sizes on different pages; Signed-off-by: Sahil Shubham <[email protected]> * added yarn token to github action; Signed-off-by: Sahil Shubham <[email protected]> * added patch changeset * reduced gap between highlight cards; Signed-off-by: Sahil Shubham <[email protected]> Signed-off-by: Sahil Shubham <[email protected]>
1 parent 870a0d7 commit b312a10

27 files changed

+171
-129
lines changed

.changeset/six-tips-smile.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'mexit': patch
3+
'mexit-webapp': patch
4+
---
5+
6+
- fixed image CDN upload from webapp
7+
- updated background of iframe rendered actions to that of extension for seamless look
8+
- displayed shortcut for commenting
9+
- updated message for when no shared notes fixed todo status in public nodes
10+
- fixed builds and added build test action
11+
- fixed referenceID for creating quick notes
12+
- made some changes towards consistent font and other sizes in extension sidebar

.github/workflows/check-build.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Check builds before PR merge
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
test:
9+
name: Test extension and webapp build
10+
env:
11+
GITHUB_TOKEN: ${{ github.token }}
12+
YARN_TOKEN: ${{ secrets.YARN_TOKEN }}
13+
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout Repo
17+
uses: actions/checkout@v2
18+
with:
19+
ref: ${{ github.event.pull_request.head.sha }}
20+
21+
22+
- name: Setup Node.js 16.x
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: 16.x
26+
27+
- name: Install Yarn Globally
28+
run: npm install -g yarn
29+
30+
- name: Install Dependencies
31+
run: yarn install --network-timeout 1000000 --frozen-lockfile --prefer-offline
32+
33+
- name: Build Webapp
34+
run: yarn nx release webapp
35+
36+
- name: Build Extension
37+
run: yarn nx build:release extension

apps/extension/src/Components/Sidebar/HighlightGroup.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import arrowUpSLine from '@iconify/icons-ri/arrow-up-s-line'
55
import fileList2Line from '@iconify/icons-ri/file-list-2-line'
66
import { Icon } from '@iconify/react'
77

8-
import { Highlight, Highlights, MEXIT_FRONTEND_URL_BASE} from '@mexit/core'
8+
import { Highlight, Highlights, MEXIT_FRONTEND_URL_BASE } from '@mexit/core'
99
import {
1010
HighlightCollapsedToggle,
1111
HighlightGroupsWrapper,

apps/extension/src/Components/Sidebar/NodeCard.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const NodeCardHeader = styled.div<{ $noHover?: boolean }>`
2525
justify-content: space-between;
2626
align-items: center;
2727
gap: ${({ theme }) => theme.spacing.tiny};
28-
font-size: 1.15rem;
28+
font-size: 1.1em;
2929
cursor: pointer;
3030
user-select: none;
3131
`
@@ -105,14 +105,14 @@ export const NodeCard = ({ nodeId }: { nodeId: string }) => {
105105
</GenericFlex>
106106
<GenericFlex>
107107
{isNodePublic ? (
108+
<IconButton title="Make Note Public" size="16px" icon="material-symbols:public" onClick={onNotePublic} />
109+
) : (
108110
<IconButton
109-
title="Make Note Public"
111+
title="Make Note Private"
110112
size="16px"
111113
icon="material-symbols:public-off-rounded"
112114
onClick={onNotePublic}
113115
/>
114-
) : (
115-
<IconButton title="Make Note Private" size="16px" icon="material-symbols:public" onClick={onNotePublic} />
116116
)}
117117
{isNodePublic && (
118118
<CopyButton

apps/extension/src/Components/Sidebar/ShortenerComponent.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const UrlTitleWrapper = styled(LinkTitleWrapper)`
3030
3131
background-color: ${({ theme }) => theme.colors.gray[9]};
3232
color: ${({ theme }) => theme.colors.text.fade};
33-
font-size: 1rem;
33+
font-size: 1em;
3434
width: 100%;
3535
border-radius: ${({ theme }) => theme.borderRadius.small};
3636
padding: 0.25rem 0;

apps/extension/src/Components/Sidebar/SnippetCard.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import {
1414
RelativeTime,
1515
SnippetCardFooter,
1616
SnippetCardWrapper,
17-
SnippetContentPreview} from '@mexit/shared'
17+
SnippetContentPreview
18+
} from '@mexit/shared'
1819

1920
import { useDescriptionStore } from '../../Stores/useDescriptionStore'
2021
import { useSnippetStore } from '../../Stores/useSnippetStore'

apps/extension/src/Components/Sidebar/SnippetsInfoBar.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect,useRef, useState } from 'react'
1+
import React, { useEffect, useRef, useState } from 'react'
22
import toast from 'react-hot-toast'
33

44
import searchLine from '@iconify/icons-ri/search-line'
@@ -23,7 +23,8 @@ import {
2323
SidebarListFilter,
2424
SidebarListFilterWrapper,
2525
SnippetCards,
26-
SnippetSidebarHelp} from '@mexit/shared'
26+
SnippetSidebarHelp
27+
} from '@mexit/shared'
2728

2829
import { CopyTag } from '../../Editor/components/Tags/CopyTag'
2930
import { generateEditorPluginsWithComponents } from '../../Editor/plugins/index'

apps/extension/src/Components/Sidebar/styled.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ export const SidebarContainer = styled.div`
1717
position: fixed;
1818
z-index: 9999999999;
1919
20+
font-size: 1em;
2021
color: ${({ theme }) => theme.colors.text.heading};
2122
`

apps/extension/src/Components/Tooltip/index.tsx

+1-20
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function Tooltip() {
2727
const { getILinkFromNodeid } = useLinks()
2828
const { removeHighlight } = useHighlighter()
2929

30-
mog('tooltipState', { tooltipState })
30+
// mog('tooltipState', { tooltipState })
3131

3232
const editableMap = getEditableMap(tooltipState?.id)
3333

@@ -58,25 +58,6 @@ function Tooltip() {
5858
})
5959
}
6060

61-
// used to open the note in the sputlit editor
62-
//const handleEdit = () => {
63-
// mog('edit, UNIMPLEMENTED')
64-
// return
65-
// const content = getContent(nodeId)
66-
// const node = getILinkFromNodeid(nodeId)
67-
// setVisualState(VisualState.animatingIn)
68-
69-
// // TODO: the timeout is because the nodeContent setting in the content/index.ts according to the active item works as well
70-
// // will optimize later
71-
// setTimeout(() => {
72-
// setNode({ ...node, title: node.path.split(SEPARATOR).slice(-1)[0], id: node.nodeid })
73-
// setNodeContent(content.content)
74-
// setPreviewMode(false)
75-
// }, 500)
76-
77-
// setTooltipState({ visualState: VisualState.hidden })
78-
// }
79-
8061
const handleCopyClipboard = async (text: string) => {
8162
await copyTextToClipboard(text)
8263
setTooltipState({ visualState: VisualState.hidden })

apps/extension/src/Hooks/useSaveChanges.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export function useSaveChanges() {
8282
id: node.nodeid,
8383
title: node.title,
8484
content: editorState,
85-
referenceID: isSingle ? undefined : parentILink?.nodeid,
85+
referenceID: isSingle ? parentILink?.nodeid : undefined,
8686
workspaceID: workspaceDetails.id,
8787
namespaceID: namespace.id,
8888
highlightId: undefined
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,44 @@
11
import { useMemo } from 'react'
2-
import { useMediaQuery } from 'react-responsive'
32
import { useSpring } from 'react-spring'
43

54
import { useTheme } from 'styled-components'
65

7-
import { OverlaySidebarWindowWidth, size } from '@mexit/shared'
8-
96
import { useLayoutStore } from '../Stores/useLayoutStore'
107

118
export const useSidebarTransition = () => {
129
const rhSidebar = useLayoutStore((state) => state.rhSidebar)
1310
const theme = useTheme()
1411

15-
const isDesktop = useMediaQuery({ minWidth: size.wide })
16-
const overlaySidebar = useMediaQuery({ maxWidth: OverlaySidebarWindowWidth })
17-
1812
const rhSidebarStyle = useMemo(() => {
1913
const showRHSidebar = rhSidebar.show && rhSidebar.expanded
20-
const visibleEndColumnWidth = `${isDesktop ? '600px' : '415px'}`
14+
const visibleEndColumnWidth = '415px'
2115
const endColumnWidth = `${showRHSidebar ? visibleEndColumnWidth : '0px'}`
22-
if (!overlaySidebar) {
23-
const style = {
24-
width: endColumnWidth
25-
}
26-
return style
27-
} else {
28-
const style = {
29-
width: endColumnWidth
30-
}
31-
return style
16+
const style = {
17+
width: endColumnWidth
3218
}
33-
}, [rhSidebar, overlaySidebar, isDesktop])
19+
20+
return style
21+
}, [rhSidebar])
22+
3423
const rhSidebarSpringProps = useSpring(rhSidebarStyle)
3524

3625
const { style: gridStyle, endColumnWidth } = useMemo(() => {
3726
const showRHSidebar = rhSidebar.show && rhSidebar.expanded
38-
const visibleEndColumnWidth = `${isDesktop ? '600px' : '415px'}`
27+
const visibleEndColumnWidth = '415px'
3928
const endColumnWidth = `${showRHSidebar ? visibleEndColumnWidth : '0px'}`
40-
const themeGap = `${theme.additional.hasBlocks ? '4rem' : '0rem'}`
4129
// mog('Overlay', { overlaySidebar, showSidebar, showRHSidebar })
42-
if (!overlaySidebar) {
43-
const style = {
44-
gridTemplateColumns: `calc(100vw - ${endColumnWidth} - ${themeGap}) ${endColumnWidth}`
45-
}
46-
// if (!sidebar.expanded || !sidebar.show) style.gridTemplateColumns = `${sidebarCollapsedWidth} 2fr auto`
47-
return { style, endColumnWidth }
48-
} else {
49-
const style = {
50-
gridTemplateColumns: ` calc(100vw - 0px - ${themeGap}) 0px`
51-
}
52-
return { style, endColumnWidth }
30+
const style = {
31+
gridTemplateColumns: `90vw`
5332
}
54-
}, [isDesktop, rhSidebar, overlaySidebar, theme])
33+
return { style, endColumnWidth }
34+
}, [rhSidebar, theme])
5535

5636
const gridSpringProps = useSpring({ to: gridStyle, immediate: !rhSidebar.show })
5737

5838
return {
5939
rhSidebarSpringProps,
6040
gridStyle,
6141
gridSpringProps,
62-
endColumnWidth,
63-
overlaySidebar
42+
endColumnWidth
6443
}
6544
}

apps/extension/src/Styles/GlobalStyle.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { createGlobalStyle } from 'styled-components'
22

3+
import { ThinScrollbar } from '@workduck-io/mex-components'
4+
35
import { customStyles, EditorBalloonStyles, normalize, TippyBalloonStyles } from '@mexit/shared'
46

57
export const GlobalStyle = createGlobalStyle`
@@ -43,6 +45,9 @@ export const GlobalStyle = createGlobalStyle`
4345
line-height: 1.5;
4446
font-size: 14px;
4547
48+
* {
49+
${ThinScrollbar}
50+
}
4651
4752
/* Tippy Balloon styles */
4853
${TippyBalloonStyles}

apps/webapp/src/Actions/Components/CorpBS.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { resize } from '@mexit/shared'
77
const Container = styled.div`
88
display: flex;
99
flex-direction: column;
10+
background: ${({ theme }) => theme.colors.background.app};
1011
1112
padding: 2rem;
1213

apps/webapp/src/Actions/Components/Shortener.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import styled from 'styled-components'
66
import { LoadingButton } from '@workduck-io/mex-components'
77
import { tinykeys } from '@workduck-io/tinykeys'
88

9-
import { getValidTitle, Link, metadataParser, mog,Tag } from '@mexit/core'
10-
import { AddTagMenu,copyTextToClipboard, Input, Label, LinkTagSection, resize, TagsLabel } from '@mexit/shared'
9+
import { getValidTitle, Link, metadataParser, mog, Tag } from '@mexit/core'
10+
import { AddTagMenu, copyTextToClipboard, Input, Label, LinkTagSection, resize, TagsLabel } from '@mexit/shared'
1111

1212
import { useURLsAPI } from '../../Hooks/useURLs'
1313
import { useLinkStore } from '../../Stores/useLinkStore'
@@ -17,6 +17,7 @@ const Form = styled.form`
1717
flex-direction: column;
1818
1919
padding: ${({ theme }) => `${theme.spacing.medium} ${theme.spacing.large} ${theme.spacing.large}`};
20+
background: ${({ theme }) => theme.colors.background.app};
2021
`
2122

2223
const InputRow = styled.div<{ noTopMargin?: boolean }>`

apps/webapp/src/Components/CommentsAndReactions/Comments.tsx

+21-13
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import React, { useCallback, useEffect, useMemo } from 'react'
33
import deleteBin6Line from '@iconify/icons-ri/delete-bin-6-line'
44
import { PlateProvider } from '@udecode/plate'
55

6-
import { IconButton } from '@workduck-io/mex-components'
6+
import { CenteredColumn, DisplayShortcut, IconButton } from '@workduck-io/mex-components'
77
import { tinykeys } from '@workduck-io/tinykeys'
88

99
import { Comment as CommentType, defaultContent, NodeEditorContent } from '@mexit/core'
10-
import { RelativeTime } from '@mexit/shared'
10+
import { ComboboxShortcuts, RelativeTime, ShortcutText } from '@mexit/shared'
1111

1212
import { useMentions } from '../../Hooks/useMentions'
1313
import { useAuthStore } from '../../Stores/useAuth'
@@ -118,17 +118,25 @@ export const NewComment = ({ onAddComment, byUser }: NewCommentProps) => {
118118
}, [onSubmit])
119119

120120
return (
121-
<NewCommentWrapper>
122-
<CommentAuthor>
123-
<ProfileImage size={32} email={byUser} />
124-
</CommentAuthor>
125-
<CommentEditorWrapper>
126-
<PlateProvider id={commentEditorId}>
127-
<CommentEditor content={defaultContent.content} editorId={commentEditorId} onChange={onChange} />
128-
</PlateProvider>
129-
</CommentEditorWrapper>
130-
<IconButton size={16} icon="bi:reply" title="Add Comment" onClick={onSubmit} transparent={false} />
131-
</NewCommentWrapper>
121+
<CenteredColumn>
122+
<NewCommentWrapper>
123+
<CommentAuthor>
124+
<ProfileImage size={32} email={byUser} />
125+
</CommentAuthor>
126+
<CommentEditorWrapper>
127+
<PlateProvider id={commentEditorId}>
128+
<CommentEditor content={defaultContent.content} editorId={commentEditorId} onChange={onChange} />
129+
</PlateProvider>
130+
</CommentEditorWrapper>
131+
<IconButton size={16} icon="bi:reply" title="Add Comment" onClick={onSubmit} transparent={false} />
132+
</NewCommentWrapper>
133+
<ComboboxShortcuts>
134+
<ShortcutText>
135+
<DisplayShortcut shortcut="$mod+Enter" />
136+
<div className="text">Add Comment</div>
137+
</ShortcutText>
138+
</ComboboxShortcuts>
139+
</CenteredColumn>
132140
)
133141
}
134142

0 commit comments

Comments
 (0)