Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9fee107
add files
nossila Dec 31, 2025
07cf2a9
fix duplicated uploads
nossila Jan 2, 2026
b5da89d
refactor thumbnail field
nossila Jan 2, 2026
568b7e0
add file delete and show FileUploadList idenpendently
nossila Jan 5, 2026
cd5b8d6
restructure for code reusability
nossila Jan 7, 2026
de7f69f
frontend: regenerate schema + adapt image fields to backend String co…
nossila Jun 27, 2026
dc8bb05
Merge origin/master into feature/baseapp_files
nossila Jul 11, 2026
8a505b2
profiles invitations: adapt image fields to String contract
nossila Jul 11, 2026
c9c694c
files: document zustand store correctly, drop any cast in FileUploadList
nossila Jul 11, 2026
7529c87
files: fix chunk bookkeeping and harden pause/resume in useChunkedUpload
nossila Jul 11, 2026
e3b6b4c
files: jest coverage for chunking, upload retries, store, and resume …
nossila Jul 11, 2026
97ff9d5
sync schema.graphql: ContentPost implements CommentsInterface
nossila Jul 11, 2026
46c9ce0
files: fix pause/resume — pause no longer marks upload FAILED, UI res…
nossila Jul 11, 2026
5802080
files: split web components into composable trigger + chip list (Base…
nossila Jul 12, 2026
60ad1a5
files: loading state on remove/delete + attach trigger in comment act…
nossila Jul 12, 2026
d773ac9
files: fix broken image preview + chip max-width
nossila Jul 13, 2026
3da3ba6
files: drop source preview while uploading, show generic icon
nossila Jul 13, 2026
f3c626f
comments: attach files on create via deferred upload
nossila Jul 13, 2026
fad5a54
files: scope uploads so progress shows only on its own composer
nossila Jul 13, 2026
dc95538
files: on completed upload hide progress bar, allow remove
nossila Jul 14, 2026
b8c1561
Merge remote-tracking branch 'origin/master' into feature/baseapp_files
nossila Sep 11, 2026
61f85a0
Merge remote-tracking branch 'origin/master' into feature/baseapp_files
nossila Oct 1, 2026
0469950
Merge silverlogic/baseapp-frontend#413: files module
nossila Oct 3, 2026
ceeff1b
test: mock GraphQL image fields as URL strings
nossila Oct 3, 2026
c297fac
test(files): port the files module tests from Jest to Vitest
nossila Oct 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ export const mockResolvers = {
user: {
id: 'user-1',
fullName: 'John Doe',
avatar: {
url: 'https://nyc3.digitaloceanspaces.com/baseapp-production-storage/media/user-avatars/5/6/4/resized/50/50/185a04dfdaa512d218cf9b7a5097e3c9.png',
},
avatar:
'https://nyc3.digitaloceanspaces.com/baseapp-production-storage/media/user-avatars/5/6/4/resized/50/50/185a04dfdaa512d218cf9b7a5097e3c9.png',
},
reactionsCount: {
total: 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const SocialInput = forwardRef<HTMLInputElement, SocialInputProps>(
SocialTextField = DefaultSocialTextField,
SocialTextFieldProps = {},
SocialUpsertActions = DefaultSocialUpsertActions,
SocialUpsertActionsProps = {},
SubmitActions = DefaultSubmitActions,
SubmitActionsProps = {},
Form = DefaultForm,
Expand Down Expand Up @@ -116,7 +117,7 @@ const SocialInput = forwardRef<HTMLInputElement, SocialInputProps>(
onCancelReply={onCancelReply}
{...SocialTextFieldProps}
>
<SocialUpsertActions />
<SocialUpsertActions {...SocialUpsertActionsProps} />
<SubmitActions
formId={formId}
disabled={isCreateButtonDisabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export interface SocialInputProps {
mode?: SocialTextFieldMode
SocialTextField?: FC<SocialTextFieldProps>
SocialTextFieldProps?: Partial<SocialTextFieldProps>
SocialUpsertActions?: FC
SocialUpsertActions?: FC<any>
SocialUpsertActionsProps?: Record<string, any>
SubmitActions?: FC<SubmitActionsProps>
SubmitActionsProps?: Partial<SubmitActionsProps>
Form?: ComponentType<ComponentPropsWithoutRef<'form'>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ export const ActivityLogsFragmentQuery = graphql`
id
fullName
email
avatar(width: 48, height: 48) {
url
}
avatar(width: 48, height: 48)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ export const DefaultLogItem: Story = {
id: 'user-1',
fullName: 'Alice Doe',
email: 'alice@example.com',
avatar: {
url: 'https://placehold.co/48x48',
},
avatar: 'https://placehold.co/48x48',
},
},
{
Expand All @@ -54,9 +52,7 @@ export const DefaultLogItem: Story = {
id: 'user-2',
fullName: 'Bob Smith',
email: 'bob@example.com',
avatar: {
url: 'https://placehold.co/48x48?text=Bob',
},
avatar: 'https://placehold.co/48x48?text=Bob',
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const LogGroups: FC<LogGroupsProps> = ({
}
const renderAvatar = (group: LogGroup) => {
if (group.logs[0]?.user == null) return <AvatarDeletedUserIcon />
return <GroupAvatar width={40} height={40} src={group.logs[0]?.user?.avatar?.url ?? ''} />
return <GroupAvatar width={40} height={40} src={group.logs[0]?.user?.avatar ?? ''} />
}

const renderItemContent = (group: LogGroup) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ export const DefaultLogItem: Story = {
id: 'user-1',
fullName: 'Mock User',
email: 'mock@tsl.io',
avatar: {
url: 'https://placehold.co/48x48',
},
avatar: 'https://placehold.co/48x48',
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ export const mockData = {
id: '1234',
fullName: 'Activity User',
email: 'test@tsl.io',
avatar: {
url: 'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/2162b9f5-3c50-4b45-8d33-9fdb28f5dee4.JPG.48x48_q85.jpg',
},
avatar:
'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/2162b9f5-3c50-4b45-8d33-9fdb28f5dee4.JPG.48x48_q85.jpg',
},
__typename: 'ActivityLog',
},
Expand All @@ -30,9 +29,8 @@ export const mockData = {
id: '5678',
fullName: 'Activity User',
email: 'test@tsl.io',
avatar: {
url: 'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/2162b9f5-3c50-4b45-8d33-9fdb28f5dee4.JPG.48x48_q85.jpg',
},
avatar:
'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/2162b9f5-3c50-4b45-8d33-9fdb28f5dee4.JPG.48x48_q85.jpg',
},
__typename: 'ActivityLog',
},
Expand All @@ -48,9 +46,8 @@ export const mockData = {
id: '91011',
fullName: 'Activity User',
email: 'test@tsl.io',
avatar: {
url: 'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/2162b9f5-3c50-4b45-8d33-9fdb28f5dee4.JPG.48x48_q85.jpg',
},
avatar:
'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/2162b9f5-3c50-4b45-8d33-9fdb28f5dee4.JPG.48x48_q85.jpg',
},
__typename: 'ActivityLog',
},
Expand All @@ -66,9 +63,8 @@ export const mockData = {
id: '1213',
fullName: 'Test User',
email: 'test2@tsl.io',
avatar: {
url: 'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
avatar:
'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
__typename: 'ActivityLog',
},
Expand All @@ -84,9 +80,8 @@ export const mockData = {
id: '1415',
fullName: 'Test User',
email: 'test2@tsl.io',
avatar: {
url: 'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
avatar:
'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
__typename: 'ActivityLog',
},
Expand All @@ -102,9 +97,8 @@ export const mockData = {
id: '1617',
fullName: 'Test User',
email: 'test2@tsl.io',
avatar: {
url: 'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
avatar:
'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
__typename: 'ActivityLog',
},
Expand All @@ -120,9 +114,8 @@ export const mockData = {
id: '1819',
fullName: 'Test User',
email: 'test2@tsl.io',
avatar: {
url: 'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
avatar:
'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
__typename: 'ActivityLog',
},
Expand All @@ -138,9 +131,8 @@ export const mockData = {
id: '2021',
fullName: 'Test User',
email: 'test2@tsl.io',
avatar: {
url: 'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
avatar:
'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
__typename: 'ActivityLog',
},
Expand Down Expand Up @@ -220,9 +212,8 @@ export const mockData = {
id: '3031',
fullName: 'Test User',
email: 'test2@tsl.io',
avatar: {
url: 'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
avatar:
'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
__typename: 'ActivityLog',
},
Expand All @@ -238,9 +229,8 @@ export const mockData = {
id: '3233',
fullName: 'Test User',
email: 'test2@tsl.io',
avatar: {
url: 'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
avatar:
'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
__typename: 'ActivityLog',
},
Expand All @@ -256,9 +246,8 @@ export const mockData = {
id: '3435',
fullName: 'Test User',
email: 'test2@tsl.io',
avatar: {
url: 'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
avatar:
'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
__typename: 'ActivityLog',
},
Expand All @@ -274,9 +263,8 @@ export const mockData = {
id: '3637',
fullName: 'Test User',
email: 'test2@tsl.io',
avatar: {
url: 'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
avatar:
'https://nyc3.digitaloceanspaces.com/baseapp-db-staging/media/profile_images/7069d845-181f-45c8-ab45-ca10c0f7937f.JPG.48x48_q85.jpg',
},
__typename: 'ActivityLog',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ export const CommentItemFragmentQuery = graphql`
profile {
id
name
image(width: 50, height: 50) {
url
}
image(width: 50, height: 50)
urlPath {
path
}
Expand Down Expand Up @@ -51,6 +49,8 @@ export const CommentItemFragmentQuery = graphql`
...ReactionButton_target

...CommentItem_target

...FilesList_target
}
`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const useCommentCreateForm = ({
if (expandRepliesOnSuccess && inReplyToId) {
setCommentIdToExpand(inReplyToId)
}
onSuccess?.({ inReplyToId })
onSuccess?.({ inReplyToId, commentId: response?.commentCreate?.comment?.node?.id })
}
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface UseCommentCreateFormOptions {
* leaving reply mode. Used by the native single composer; web keeps the draft.
*/
resetFormOnReplyTargetChange?: boolean
onSuccess?: (context: { inReplyToId?: string }) => void
onSuccess?: (context: { inReplyToId?: string; commentId?: string }) => void
}

export interface UseCommentCreateFormReturn {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const CommentItem: FC<CommentItemProps> = ({
the avatar/name would be claimed by the inner pressable and never open the
action sheet. */}
<Pressable onPress={goToProfile} onLongPress={openActions}>
<AvatarWithPlaceholder imgSource={comment.profile?.image?.url} />
<AvatarWithPlaceholder imgSource={comment.profile?.image ?? undefined} />
</Pressable>
</View>
<View style={styles.bodyContainer}>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
'use client'

import type { FC } from 'react'

import { useFileSelect } from '@baseapp-frontend/components/files/common'
import { IconButton } from '@baseapp-frontend/design-system/components/web/buttons'
import { AttachmentIcon, MentionIcon } from '@baseapp-frontend/design-system/components/web/icons'

import type { CommentFilesUpsertActionsProps } from './types'

/**
* SocialInput upsert-action bar for the comment composer: the attach icon
* uploads files right away; they are attached to the comment once it is created
* (see CommentCreate). The mention icon stays a placeholder until wired.
*/
const CommentFilesUpsertActions: FC<CommentFilesUpsertActionsProps> = ({
onFilesSelected,
isUploading = false,
maxFiles,
maxFileSize,
acceptedFileTypes,
}) => {
const { open, getInputProps } = useFileSelect({
onFilesSelected,
maxFiles,
maxFileSize,
acceptedFileTypes,
disabled: isUploading,
})

return (
<div className="grid grid-cols-[repeat(2,max-content)] gap-2">
{/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}
<input {...getInputProps()} />
<IconButton
size="small"
onClick={open}
disabled={isUploading}
isLoading={isUploading}
aria-label="Attach files"
>
<AttachmentIcon />
</IconButton>
<IconButton disabled aria-label="mention">
<MentionIcon />
</IconButton>
</div>
)
}

export default CommentFilesUpsertActions
export type { CommentFilesUpsertActionsProps } from './types'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type Accept = Record<string, string[]>

export interface CommentFilesUpsertActionsProps {
/** Uploads the picked files (deferred attach happens after the comment is created). */
onFilesSelected: (files: File[]) => void
/** Shows the attach button in a loading state while uploads are in flight. */
isUploading?: boolean
maxFiles?: number
maxFileSize?: number
acceptedFileTypes?: Accept
}
Loading
Loading