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

refactor: move useRecentSessionHistory to a separate file #2763

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

yomybaby
Copy link
Member

@yomybaby yomybaby commented Oct 21, 2024

Changes:

This PR refactors the useRecentSessionHistory hook by moving it from hooks/backendai.tsx to its own file hooks/useRecentSessionHistory.tsx. The functionality remains the same, but it's now in a separate, dedicated file for better organization and maintainability.

Additionally, this PR resolves the Jest test failure related to importing a file.

Updates:

  1. SessionTemplateModal.tsx: Updated the import path for useRecentSessionHistory.
  2. hooks/backendai.tsx: Removed the useRecentSessionHistory hook and its related imports.
  3. hooks/useRecentSessionHistory.tsx: Created this new file to house the useRecentSessionHistory hook.
  4. SessionLauncherPage.tsx: Updated the import path for useRecentSessionHistory.

Rationale:

This refactoring improves code organization by separating concerns and reducing the size of the backendai.tsx file. It makes the codebase more modular and easier to maintain.

Copy link

graphite-app bot commented Oct 21, 2024

Your org requires the Graphite merge queue for merging into main

Add the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @yomybaby and the rest of your teammates on Graphite Graphite

@github-actions github-actions bot added the size:L 100~500 LoC label Oct 21, 2024
@yomybaby yomybaby marked this pull request as ready for review October 21, 2024 11:08
Copy link

github-actions bot commented Oct 21, 2024

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
5.11% (+1.07% 🔼)
348/6809
🔴 Branches
4.66% (+0.66% 🔼)
218/4682
🔴 Functions
2.98% (+0.45% 🔼)
67/2246
🔴 Lines
5.01% (+1.08% 🔼)
333/6653
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / useRecentSessionHistory.tsx
0% 0% 0% 0%

Test suite run success

93 tests passing in 12 suites.

Report generated by 🧪jest coverage report action from 39b99a9

@yomybaby yomybaby force-pushed the refactor/use-recent-session-history-to-file branch from 096614c to 39b99a9 Compare October 21, 2024 11:13
@yomybaby yomybaby merged commit 742d661 into main Oct 21, 2024
8 checks passed
@yomybaby yomybaby deleted the refactor/use-recent-session-history-to-file branch October 21, 2024 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L 100~500 LoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant