-
-
Notifications
You must be signed in to change notification settings - Fork 50
Sparshr04/GitHub copilot auth UI #201
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
Open
Sparshr04
wants to merge
32
commits into
develop
Choose a base branch
from
sparshr04/github-copilot-auth-ui
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
523e12f
Initial plan
Copilot 9aceae4
Add editable table with PDF file matching for PDF-only uploads
Copilot ae0b342
Add tests for editable table functionality
Copilot 8c8ff06
fix(ui): enable custom column editors and dropdowns in RenderTable
Sparshr04 72edcec
fix(table): emit cell-edited event for parent state synchronization
Sparshr04 c1c1c06
fix: Exclusive Multiselect Property for List Dropdown
Sparshr04 a7b9526
fix: Infinite loop condidion in RenderTable watcher and Freeze Table …
Sparshr04 1449f53
feat: add Copilot-backed chat endpoint using LiteLLM (initial)
Sparshr04 28d384d
fix: fastAPI ingestion error
Sparshr04 4cdeedf
refactor: robust async race condition mitigation version of code by d…
Sparshr04 f96f9c2
feat(ui): implement GitHub Copilot device flow authentication UI
Sparshr04 f89e931
chore(backend): update dependencies and configure worker preload
Sparshr04 48ff88d
chore: resolve merge conflicts with develop
Sparshr04 315bbf9
chore: resolve merge conflicts with develop
Sparshr04 164b880
refactor: update dependencies and enhance table functionality
JonnyTran 6d8dea3
Merge branch 'develop' into sparshr04/litellm-copilot-integration
JonnyTran 7aee709
chore: update litellm dependency version in pyproject.toml and uv.loc…
JonnyTran 4087807
revert: remove unused BaseSimpleTable import and clean up useImportFi…
JonnyTran cb52a12
feat: remove pdm.lock file and update GitHub authentication response …
JonnyTran ab7412e
feat: enhance GitHub authentication flow and update dependencies
JonnyTran 2c1ed55
Merge branch 'develop' into sparshr04/litellm-copilot-integration
JonnyTran 8db7d5e
feat: enhance GitHub authentication with authlib and file locking
JonnyTran 14e4b87
Merge branch 'develop' into sparshr04/github-copilot-auth-ui
JonnyTran 95da157
Merge branch 'sparshr04/litellm-copilot-integration' into sparshr04/g…
JonnyTran 64b2606
feat: improve GitHub Copilot connection handling and error messaging
JonnyTran 401a8d8
merge from develop
JonnyTran 13d98ad
refactor: replace authlib with httpx for GitHub OAuth device flow
JonnyTran c9c1c8d
Merge remote-tracking branch 'origin/develop' into sparshr04/github-c…
JonnyTran 6bac786
fix: update Python version requirement in pyproject.toml
JonnyTran 332f00c
Merge branch 'develop' into sparshr04/github-copilot-auth-ui
JonnyTran ad5f71f
Merge develop and fix CI: resolve conflicts, update Python matrix
JonnyTran 93096bb
fix: add placeholder test to empty spec file to fix CI
JonnyTran File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| describe("useImportFileUploadViewModel", () => { | ||
| it("should be defined", () => { | ||
| expect(true).toBe(true); | ||
| }); | ||
| }); |
187 changes: 187 additions & 0 deletions
187
extralit-frontend/components/features/user-settings/CopilotConnect.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,187 @@ | ||
| <template> | ||
| <div class="copilot-connect"> | ||
| <!-- Connected State --> | ||
| <div v-if="isAuthenticated" class="copilot-connect__status copilot-connect__status--connected"> | ||
| <span class="copilot-connect__icon">✓</span> | ||
| <span class="copilot-connect__label">GitHub Copilot Connected</span> | ||
| </div> | ||
|
|
||
| <!-- Pending State --> | ||
| <div v-else-if="isPending" class="copilot-connect__status copilot-connect__status--pending"> | ||
| <div class="copilot-connect__instructions"> | ||
| <p class="copilot-connect__text"> | ||
| Go to | ||
| <a | ||
|
Check failure on line 14 in extralit-frontend/components/features/user-settings/CopilotConnect.vue
|
||
| :href="verificationUri" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| class="copilot-connect__link" | ||
| >{{ verificationUri }}</a> | ||
| and enter the code: | ||
| </p> | ||
| <div class="copilot-connect__code-box"> | ||
| <code class="copilot-connect__code">{{ userCode }}</code> | ||
| </div> | ||
| </div> | ||
| <div class="copilot-connect__spinner-row"> | ||
| <span class="copilot-connect__spinner" /> | ||
| <span class="copilot-connect__waiting-text">Waiting for authorization…</span> | ||
| </div> | ||
| </div> | ||
|
|
||
| <!-- Disconnected State --> | ||
| <div v-else class="copilot-connect__status copilot-connect__status--disconnected"> | ||
| <p v-if="errorMessage" class="copilot-connect__error">{{ errorMessage }}</p> | ||
| <button | ||
|
Check failure on line 35 in extralit-frontend/components/features/user-settings/CopilotConnect.vue
|
||
| class="copilot-connect__button" | ||
| :disabled="isPending" | ||
| @click="connectCopilot" | ||
| > | ||
| Connect Copilot | ||
| </button> | ||
| </div> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script> | ||
| import { useCopilotConnectViewModel } from "./useCopilotConnectViewModel"; | ||
|
|
||
| export default { | ||
| setup() { | ||
| return useCopilotConnectViewModel(); | ||
| }, | ||
| }; | ||
| </script> | ||
|
|
||
| <style lang="scss" scoped> | ||
| .copilot-connect { | ||
| padding: $base-space * 2 0; | ||
|
|
||
| &__status { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: $base-space * 2; | ||
| flex-wrap: wrap; | ||
|
|
||
| &--connected { | ||
| color: var(--fg-primary); | ||
| } | ||
|
|
||
| &--pending { | ||
| flex-direction: column; | ||
| align-items: flex-start; | ||
| gap: $base-space * 3; | ||
| } | ||
|
|
||
| &--disconnected { | ||
| // defaults are fine | ||
| } | ||
| } | ||
|
|
||
| &__icon { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| width: 24px; | ||
| height: 24px; | ||
| border-radius: 50%; | ||
| background-color: #2da44e; | ||
| color: #fff; | ||
| font-size: 14px; | ||
| font-weight: bold; | ||
| flex-shrink: 0; | ||
| } | ||
|
|
||
| &__label { | ||
| font-weight: 500; | ||
| color: var(--fg-primary); | ||
| } | ||
|
|
||
| &__instructions { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: $base-space; | ||
| } | ||
|
|
||
| &__text { | ||
| margin: 0; | ||
| color: var(--fg-secondary); | ||
| } | ||
|
|
||
| &__link { | ||
| color: var(--color-brand); | ||
| text-decoration: underline; | ||
|
|
||
| &:hover { | ||
| text-decoration: none; | ||
| } | ||
| } | ||
|
|
||
| &__code-box { | ||
| display: inline-flex; | ||
| padding: $base-space $base-space * 2; | ||
| background: var(--bg-opacity-4); | ||
| border: 1px solid var(--bg-opacity-10); | ||
| border-radius: 6px; | ||
| } | ||
|
|
||
| &__code { | ||
| font-family: monospace; | ||
| font-size: 18px; | ||
| font-weight: 600; | ||
| letter-spacing: 3px; | ||
| color: var(--fg-primary); | ||
| } | ||
|
|
||
| &__spinner-row { | ||
| display: flex; | ||
| align-items: center; | ||
| gap: $base-space; | ||
| } | ||
|
|
||
| &__spinner { | ||
| display: inline-block; | ||
| width: 16px; | ||
| height: 16px; | ||
| border: 2px solid var(--bg-opacity-10); | ||
| border-top-color: var(--color-brand); | ||
| border-radius: 50%; | ||
| animation: copilot-spin 0.8s linear infinite; | ||
| } | ||
|
|
||
| &__waiting-text { | ||
| color: var(--fg-secondary); | ||
| font-size: 13px; | ||
| } | ||
|
|
||
| &__error { | ||
| margin: 0 0 $base-space 0; | ||
| color: #cf222e; | ||
| font-size: 13px; | ||
| } | ||
|
|
||
| &__button { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| padding: $base-space $base-space * 3; | ||
| background-color: var(--color-brand); | ||
| color: #fff; | ||
| border: none; | ||
| border-radius: 6px; | ||
| font-size: 14px; | ||
| font-weight: 500; | ||
| cursor: pointer; | ||
| transition: background-color 0.2s ease; | ||
|
|
||
| &:hover { | ||
| opacity: 0.9; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @keyframes copilot-spin { | ||
| to { | ||
| transform: rotate(360deg); | ||
| } | ||
| } | ||
| </style> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
extralit-frontend/components/features/user-settings/useCopilotConnectViewModel.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import { useFetch, onBeforeUnmount } from "@nuxtjs/composition-api"; | ||
| import { useResolve } from "ts-injecty"; | ||
| import { computed } from "vue-demi"; | ||
| import { GitHubAuthUseCase } from "~/v1/domain/usecases/github-auth-use-case"; | ||
| import { useGitHubAuth } from "~/v1/infrastructure/storage/GitHubAuthStorage"; | ||
|
|
||
| export const useCopilotConnectViewModel = () => { | ||
| const gitHubAuthUseCase = useResolve(GitHubAuthUseCase); | ||
| const store = useGitHubAuth(); | ||
|
|
||
| const isAuthenticated = computed(() => store.state.isAuthenticated); | ||
| const isPending = computed(() => store.state.isPending); | ||
| const userCode = computed(() => store.state.userCode); | ||
| const verificationUri = computed(() => store.state.verificationUri); | ||
| const errorMessage = computed(() => store.state.errorMessage); | ||
|
|
||
| useFetch(async () => { | ||
| await gitHubAuthUseCase.checkStatus(); | ||
| }); | ||
|
|
||
| const connectCopilot = async () => { | ||
| if (isPending.value) return; | ||
| await gitHubAuthUseCase.initiateLogin(); | ||
| }; | ||
|
|
||
| onBeforeUnmount(() => { | ||
| gitHubAuthUseCase.clearPolling(); | ||
| }); | ||
|
|
||
| return { | ||
| isAuthenticated, | ||
| isPending, | ||
| userCode, | ||
| verificationUri, | ||
| errorMessage, | ||
| connectCopilot, | ||
| }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new section title is hardcoded (
GitHub Copilot) while the rest of the settings page uses$t(...)for i18n. Please add the corresponding translation key and use$there for consistency with the existing localization approach.