Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Picker for Attaching Files #2126

Merged
merged 35 commits into from
Feb 13, 2025
Merged

File Picker for Attaching Files #2126

merged 35 commits into from
Feb 13, 2025

Conversation

FadhlanR
Copy link
Contributor

@FadhlanR FadhlanR commented Feb 7, 2025

Screen.Recording.2025-02-11.at.15.33.02.mov
  • Refactored directory and file tree component so it can reused in the attach file modal.
  • Added feature flag for attaching files in AI Assitant.
  • Added attach file modal component.

Copy link

github-actions bot commented Feb 7, 2025

Host Test Results

    1 files  ±0      1 suites  ±0   24m 43s ⏱️ + 1m 49s
762 tests +2  759 ✔️ +4  3 💤 ±0  0 ±0 
767 runs  +2  764 ✔️ +6  3 💤 ±0  0  - 2 

Results for commit f45e1fa. ± Comparison against base commit 9fe7e54.

♻️ This comment has been updated with latest results.

@FadhlanR FadhlanR force-pushed the cs-7948-file-picker branch from a4a11d9 to e8e4147 Compare February 7, 2025 11:36
@FadhlanR FadhlanR force-pushed the cs-7948-file-picker branch from e8e4147 to bd7af13 Compare February 7, 2025 11:38
@jurgenwerk
Copy link
Contributor

jurgenwerk commented Feb 11, 2025

@FadhlanR I have a draft PR up for displaying FileDefs in the AI assistant (auto-attached file in code mode). Perhaps you can rebase work on top of that. It is also ok if you'd like to merge this first without integrating with my PR, and do the integration in the AI assistant later. But let's think about how to minimize merge conflicts.

#2135

@FadhlanR FadhlanR marked this pull request as ready for review February 11, 2025 11:22
@FadhlanR FadhlanR requested review from jurgenwerk and removed request for jurgenwerk February 11, 2025 11:22
@FadhlanR FadhlanR requested review from jurgenwerk and a team February 11, 2025 11:29
@FadhlanR
Copy link
Contributor Author

@FadhlanR I have a draft PR up for displaying FileDefs in the AI assistant (auto-attached file in code mode). Perhaps you can rebase work on top of that. It is also ok if you'd like to merge this first without integrating with my PR, and do the integration in the AI assistant later. But let's think about how to minimize merge conflicts.

#2135

@jurgenwerk if this PR is ok to merge, I'll merge it and will rebase your PR. The feature flag introduced in this PR also can be used in yours.

packages/host/app/components/pill.gts Outdated Show resolved Hide resolved
packages/host/app/components/pill.gts Outdated Show resolved Hide resolved
packages/host/app/components/pill.gts Outdated Show resolved Hide resolved
…nto-the-ai-assistant' into cs-7948-file-picker
@FadhlanR FadhlanR changed the base branch from main to cs-7853-add-ability-to-attach-code-you-are-looking-at-into-the-ai February 11, 2025 15:07
@FadhlanR FadhlanR changed the base branch from cs-7853-add-ability-to-attach-code-you-are-looking-at-into-the-ai to cs-7853-add-ability-to-attach-code-you-are-looking-at-into-the-ai-assistant February 11, 2025 15:08
Copy link
Contributor

@burieberry burieberry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works as expected.

@FadhlanR FadhlanR requested a review from jurgenwerk February 12, 2025 07:56
@jurgenwerk
Copy link
Contributor

jurgenwerk commented Feb 12, 2025

@FadhlanR I was testing this and see this PR already includes the autoattached behaviour from #2135. So I see no point in maintaining a separate PR anymore since your PR now has that functionality almost in whole. I suggest you merge (or cherry pick the new commits if that is easier) my latest changes (my PR branch is green and ready to go). The latest changes include removing files from being attached, a test, and some type adjustments. I chose not to implement a resource for the autoattached files like we do with attached cards because here the situation is much simpler since we don't have any stacks, just the currently opened file. Let me know if you are ok with rebasing and then we can close my PR and move the rest of the todo into a separate ticket.

@FadhlanR
Copy link
Contributor Author

FadhlanR commented Feb 12, 2025

@FadhlanR I was testing this and see this PR already includes the autoattached behaviour from #2135. So I see no point in maintaining a separate PR anymore since your PR now has that functionality almost in whole. I suggest you merge (or cherry pick the new commits if that is easier) my latest changes (my PR branch is green and ready to go). The latest changes include removing files from being attached, a test, and some type adjustments. I chose not to implement a resource for the autoattached files like we do with attached cards because here the situation is much simpler since we don't have any stacks, just the currently opened file. Let me know if you are ok with rebasing and then we can close my PR and move the rest of the todo into a separate ticket.

Sounds good. I'll include your latest updates to this PR.

@FadhlanR FadhlanR requested a review from jurgenwerk February 12, 2025 14:40
@FadhlanR
Copy link
Contributor Author

@jurgenwerk I've rebased this PR to your latest updates. And I made some updates for the auto-attached file.

@FadhlanR FadhlanR changed the base branch from cs-7853-add-ability-to-attach-code-you-are-looking-at-into-the-ai-assistant to main February 12, 2025 15:01
return cards;
}

private get allFilesToAttach() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using "all" in the name is redundant. We can just use filesToAttach. It should include all files shown in the attachments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged autoAttachedFile and filesToAttach directly in the sendMessage function, following the same approach we use for autoAttachedCards and cardsToAttach.

packages/host/app/components/matrix/room.gts Outdated Show resolved Hide resolved
packages/host/app/components/matrix/room.gts Outdated Show resolved Hide resolved
@FadhlanR FadhlanR requested a review from jurgenwerk February 13, 2025 07:46
@jurgenwerk jurgenwerk merged commit 981db49 into main Feb 13, 2025
49 checks passed
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