Skip to content

Conversation

@louis-jan
Copy link
Contributor

Describe Your Changes

  • This PR fixed the attachment open path for new thread structures. Previously, files were located at threads/{id}/files. Now, we're introducing a new files folder.

Self Checklist

  1. usePath.ts:

    • Added import { fs } from '@janhq/core' and import { getFileInfo } from '@/utils/file'.
    • Modified the onViewFile function to handle new ID systems, using getFileInfo to retrieve file information.
  2. ChatInput/index.tsx:

    • Changed the way fileUpload is accessed in renderPreview.
  3. DocMessage.tsx:

    • Removed memoization and replaced with functional component.
    • Used useState and useEffect to handle file info fetching dynamically.
    • Updated rendering logic to use fetched file information.
  4. ImageMessage.tsx:

    • Simplified the component by removing unused logic and ensuring proper type definitions.
  5. RelativeImage.tsx:

    • Added a conditional class for cursor styling based on whether onClick is provided.
  6. TextMessage/index.tsx:

    • Updated the way attachedFile is handled in the message rendering logic.
  7. file.ts:

    • Added a new function getFileInfo to fetch file information from the server.

These changes involve adding utility functions, refactoring components for better performance and readability, and handling dynamic data fetching more effectively.

@github-actions
Copy link
Contributor

This is the build for this pull request. You can download it from the Artifacts section here: Build URL.

@louis-jan louis-jan force-pushed the fix/message-attachments-preview branch from beaf811 to 3a9c999 Compare December 17, 2024 11:59
@louis-jan louis-jan merged commit 0cd0ff0 into dev Dec 17, 2024
10 checks passed
@louis-jan louis-jan deleted the fix/message-attachments-preview branch December 17, 2024 14:22
@github-actions github-actions bot added this to the v0.5.12 milestone Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants