Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
uses: actions/setup-node@v6
with:
node-version: '20'
node-version: '24'
cache: 'npm'
cache-dependency-path: |
package-lock.json
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:

- name: Upload build artifact
id: artifact-upload
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
uses: actions/upload-artifact@v6
with:
name: build-${{ github.run_id }}
path: ./out
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
uses: actions/checkout@v6
with:
fetch-depth: 1

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/component-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: '20'
node-version: '24'
cache: 'npm'

- name: Install dependencies
Expand Down Expand Up @@ -191,7 +191,7 @@ jobs:

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: component-test-results-${{ github.run_id }}
path: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,16 @@ jobs:

steps:
- name: Checkout E2E repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
repository: koreyba/EverFreeNote-e2e
ref: ${{ needs.resolve-e2e-branch.outputs.e2e_ref }}
path: e2e

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: "20"
node-version: "24"
cache: npm
cache-dependency-path: e2e/package-lock.json

Expand Down Expand Up @@ -302,7 +302,7 @@ jobs:

- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: playwright-report-${{ github.run_id }}
path: |
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: "20"
node-version: "24"
cache: "npm"
cache-dependency-path: |
package-lock.json
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:

- name: Upload mobile unit test report
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: unit-test-report-mobile-${{ github.run_id }}
path: ui/mobile/results.json
Expand All @@ -160,12 +160,12 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: "20"
node-version: "24"
cache: "npm"
cache-dependency-path: package-lock.json

Expand Down Expand Up @@ -288,7 +288,7 @@ jobs:

- name: Upload core test reports
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: unit-test-report-core-${{ github.run_id }}
path: |
Expand All @@ -306,12 +306,12 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v6
with:
node-version: "20"
node-version: "24"
cache: "npm"
cache-dependency-path: package-lock.json

Expand Down Expand Up @@ -429,7 +429,7 @@ jobs:

- name: Upload web unit test report
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: unit-test-report-web-${{ github.run_id }}
path: web-unit-results.json
Expand Down
55 changes: 42 additions & 13 deletions app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import { useEffect } from "react"
import { useEffect, useEffectEvent } from "react"
import { Loader2 } from "lucide-react"
import { toast } from "sonner"

Expand All @@ -9,23 +9,34 @@ import { NotesShell } from "@/components/features/notes/NotesShell"
import { useNoteAppController } from "@ui/web/hooks/useNoteAppController"
import { featureFlags } from "@ui/web/featureFlags"
import { consumeSettingsReturnState } from "@ui/web/lib/settingsNavigationState"
import {
clearActiveSettingsNoteReturnPath,
consumeAIIndexPendingNoteState,
saveActiveSettingsNoteReturnPath,
} from "@ui/web/lib/aiIndexNavigationState"

export default function App() {
const controller = useNoteAppController()
const { user, loading, handleTestLogin, handleSkipAuth, handleSignInWithGoogle } = controller

const restoreUiState = useEffectEvent((state: Parameters<typeof controller.restoreUiState>[0]) => {
controller.restoreUiState(state).catch(() => {
// The controller already surfaces restore failures to the user.
})
})

// Show auth error from URL params
useEffect(() => {
if (typeof window !== 'undefined') {
const params = new URLSearchParams(window.location.search)
const error = params.get('error')
const message = params.get('message')

if (error === 'auth_callback_failed') {
toast.error(`Authentication failed: ${message || 'Unknown error'}`)
// Clean up URL
window.history.replaceState({}, '', '/')
}
if (globalThis.window === undefined) return

const params = new URLSearchParams(globalThis.location.search)
const error = params.get('error')
const message = params.get('message')

if (error === 'auth_callback_failed') {
toast.error(`Authentication failed: ${message || 'Unknown error'}`)
// Clean up URL
globalThis.history.replaceState({}, '', '/')
}
}, [])

Expand All @@ -35,8 +46,26 @@ export default function App() {
const returnState = consumeSettingsReturnState()
if (!returnState) return

void controller.restoreUiState(returnState.notesUiState)
}, [controller, loading, user])
clearActiveSettingsNoteReturnPath()
restoreUiState(returnState.notesUiState)
}, [loading, user])

useEffect(() => {
if (loading || !user) return

const pendingNoteState = consumeAIIndexPendingNoteState()
if (!pendingNoteState) return

saveActiveSettingsNoteReturnPath(pendingNoteState.returnPath)
restoreUiState({
selectedNoteId: pendingNoteState.noteId,
selectedNote: null,
isEditing: false,
isSearchPanelOpen: false,
searchQuery: '',
filterByTag: null,
})
}, [loading, user])

if (loading) {
return (
Expand Down
18 changes: 18 additions & 0 deletions core/types/aiIndex.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
export type AIIndexStatus = "indexed" | "not_indexed" | "outdated"

export type AIIndexFilter = "all" | AIIndexStatus

export interface AIIndexNoteRow {
id: string
title: string
updatedAt: string
lastIndexedAt: string | null
status: AIIndexStatus
}

export interface AIIndexNotesPage {
notes: AIIndexNoteRow[]
totalCount: number
hasMore: boolean
nextCursor?: number
}
15 changes: 10 additions & 5 deletions cypress/component/features/mobile/MobileLayout.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ describe('Mobile Layout Adaptation', () => {
let mockSupabase: SupabaseClient

beforeEach(() => {
createMockController = (overrides: Partial<NoteAppController> = {}): NoteAppController => ({
createMockController = (overrides: Partial<NoteAppController> = {}): NoteAppController => {
const handleSelectNote = cy.stub().as('handleSelectNote')
handleSelectNote.resolves()

return ({
user: mockUser,
loading: false,
notes: [],
Expand Down Expand Up @@ -50,11 +54,11 @@ describe('Mobile Layout Adaptation', () => {
observerTarget: { current: null },
deleteAccountLoading: false,

handleSelectNote: cy.stub().as('handleSelectNote'),
handleSelectNote,
handleCreateNote: cy.stub(),
handleEditNote: cy.stub(),
handleSaveNote: cy.stub(),
handleReadNote: cy.stub(),
handleEditNote: cy.stub().resolves(),
handleSaveNote: cy.stub().resolves(),
handleReadNote: cy.stub().resolves(),
handleDeleteNote: cy.stub(),
confirmDeleteNote: cy.stub(),
setDeleteDialogOpen: cy.stub(),
Expand Down Expand Up @@ -105,6 +109,7 @@ describe('Mobile Layout Adaptation', () => {
restoreUiState: overrides.restoreUiState ?? cy.stub(),
deleteNotesByIds: overrides.deleteNotesByIds ?? cy.stub().resolves({ total: 0, failed: 0, queuedOffline: false }),
})
}

mockSupabase = {
auth: {
Expand Down
2 changes: 1 addition & 1 deletion cypress/component/features/notes/SearchResultsPanel.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const createController = (overrides: Partial<NoteAppController> = {}): NoteAppCo
tagOnlyHasMore: false,
tagOnlyLoadingMore: false,
selectedNote: null,
handleSelectNote: cy.stub(),
handleSelectNote: cy.stub().resolves(),
handleTagClick: cy.stub(),
handleSearchResultClick: cy.stub(),
loadMoreFts: cy.stub(),
Expand Down
29 changes: 23 additions & 6 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading