@ripla/godd-mcp 1.0.4-canary.8 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -94
- package/dist/godd.cjs +349 -233
- package/dist/godd.js +2193 -838
- package/dist/index.js +152 -122
- package/{notes-api → notes/api}/.env.example +6 -1
- package/{notes-api → notes/api}/README.md +6 -5
- package/{notes-api → notes/api}/app/main.py +29 -2
- package/{notes-api → notes/api}/app/routers/auth.py +6 -1
- package/{notes-api → notes/api}/app/routers/issues.py +157 -1
- package/{notes-api → notes/api}/app/routers/pr.py +2 -2
- package/{notes-api → notes/api}/app/services/github_app_token.py +32 -1
- package/{notes-api → notes/api}/app/services/github_issues.py +101 -11
- package/{notes-api → notes/api}/app/services/github_pr.py +6 -1
- package/{notes-api → notes/api}/tests/test_github_app_token.py +49 -1
- package/{notes-api → notes/api}/tests/test_github_service.py +42 -0
- package/notes/api/tests/test_health.py +52 -0
- package/{notes-api → notes/api}/tests/test_issues.py +216 -0
- package/{notes-api → notes/api}/tests/test_pr.py +24 -0
- package/{notes-api → notes/api}/tests/test_pr_chain.py +19 -0
- package/{notes-api → notes/api}/uv.lock +178 -2
- package/notes/app/DESIGN.md +273 -0
- package/{notes-app → notes/app}/README.md +4 -1
- package/notes/app/docker/Dockerfile.e2e +19 -0
- package/notes/app/docker/Dockerfile.prod +15 -0
- package/notes/app/docker/Dockerfile.test +17 -0
- package/notes/app/e2e/file-tree.spec.ts +26 -0
- package/notes/app/e2e/file-view.spec.ts +25 -0
- package/notes/app/e2e/fixtures.ts +28 -0
- package/{notes-app → notes/app}/e2e/global-setup.ts +5 -7
- package/notes/app/e2e/login.spec.ts +25 -0
- package/notes/app/e2e/pages/login-page.ts +29 -0
- package/notes/app/e2e/pages/main-page.ts +29 -0
- package/notes/app/e2e/panel-resize-handle.spec.ts +213 -0
- package/{notes-app → notes/app}/eslint.config.js +9 -0
- package/{notes-app → notes/app}/package.json +0 -3
- package/{notes-app → notes/app}/pnpm-workspace.yaml +1 -0
- package/notes/app/src/components/CommentPanel.test.tsx +194 -0
- package/{notes-app → notes/app}/src/components/CommentPanel.tsx +119 -10
- package/notes/app/src/components/CommentSelectionPopover.tsx +26 -0
- package/notes/app/src/components/EditToolbar.test.tsx +102 -0
- package/{notes-app → notes/app}/src/components/EditToolbar.tsx +5 -54
- package/notes/app/src/components/FileInfoPanel.branch-tab.test.tsx +250 -0
- package/notes/app/src/components/FileInfoPanel.history-tab.test.tsx +146 -0
- package/notes/app/src/components/FileInfoPanel.test.tsx +101 -0
- package/{notes-app → notes/app}/src/components/FileInfoPanel.tsx +135 -20
- package/notes/app/src/components/IssueCommentThread.test.tsx +93 -0
- package/notes/app/src/components/IssueCommentThread.tsx +156 -0
- package/notes/app/src/components/IssueDetailView.test.tsx +1118 -0
- package/notes/app/src/components/IssueDetailView.tsx +476 -0
- package/notes/app/src/components/IssueList.test.tsx +545 -0
- package/notes/app/src/components/IssueList.tsx +374 -0
- package/{notes-app → notes/app}/src/components/LabelSelector.test.tsx +94 -8
- package/notes/app/src/components/LabelSelector.tsx +452 -0
- package/{notes-app → notes/app}/src/components/MarkdownEditor.tsx +140 -2
- package/notes/app/src/components/PanelResizeHandle.test.tsx +481 -0
- package/notes/app/src/components/PanelResizeHandle.tsx +96 -0
- package/{notes-app → notes/app}/src/hooks/useEditSession.test.ts +171 -23
- package/{notes-app → notes/app}/src/hooks/useEditSession.ts +49 -62
- package/notes/app/src/hooks/useMdUpLayout.test.ts +10 -0
- package/notes/app/src/hooks/useMdUpLayout.ts +27 -0
- package/notes/app/src/hooks/usePeriodicSync.test.ts +244 -0
- package/notes/app/src/hooks/usePeriodicSync.ts +83 -0
- package/notes/app/src/hooks/useResizablePanelWidth.test.ts +251 -0
- package/notes/app/src/hooks/useResizablePanelWidth.ts +167 -0
- package/{notes-app → notes/app}/src/lib/api.test.ts +81 -1
- package/{notes-app → notes/app}/src/lib/api.ts +98 -4
- package/notes/app/src/lib/commentAnchor.test.ts +22 -0
- package/notes/app/src/lib/commentAnchor.ts +28 -0
- package/notes/app/src/lib/commentHighlight.test.ts +110 -0
- package/notes/app/src/lib/commentHighlight.ts +44 -0
- package/notes/app/src/lib/github-sync.test.ts +126 -0
- package/notes/app/src/lib/github-sync.ts +89 -0
- package/notes/app/src/lib/issue-list-utils.test.ts +275 -0
- package/notes/app/src/lib/issue-list-utils.ts +135 -0
- package/notes/app/src/lib/issue-mobile-layout.test.ts +17 -0
- package/notes/app/src/lib/issue-mobile-layout.ts +20 -0
- package/notes/app/src/lib/issue-url-sync.test.ts +73 -0
- package/notes/app/src/lib/issue-url-sync.ts +43 -0
- package/notes/app/src/lib/main-page-default-view.test.ts +37 -0
- package/notes/app/src/lib/main-page-default-view.ts +15 -0
- package/notes/app/src/lib/resizable-panel.test.ts +199 -0
- package/notes/app/src/lib/resizable-panel.ts +136 -0
- package/notes/app/src/pages/LoginPage.test.tsx +17 -0
- package/notes/app/src/pages/MainPage.branch-modal.test.tsx +226 -0
- package/notes/app/src/pages/MainPage.issue-sync.test.tsx +145 -0
- package/notes/app/src/pages/MainPage.sidebar.test.tsx +361 -0
- package/{notes-app → notes/app}/src/pages/MainPage.tsx +406 -61
- package/{notes-app → notes/app}/src/pages/SettingsPage.test.tsx +32 -23
- package/{notes-app → notes/app}/src/pages/UserManagementPage.test.tsx +8 -18
- package/notes/app/src/test/mocks.ts +156 -0
- package/notes/app/src/test/render.tsx +27 -0
- package/package.json +3 -5
- package/notes-api/tests/test_health.py +0 -11
- package/notes-app/docker/Dockerfile.e2e +0 -14
- package/notes-app/docker/Dockerfile.prod +0 -12
- package/notes-app/docker/Dockerfile.test +0 -12
- package/notes-app/e2e/file-tree.spec.ts +0 -29
- package/notes-app/e2e/file-view.spec.ts +0 -24
- package/notes-app/e2e/login.spec.ts +0 -32
- package/notes-app/src/components/IssueDetailView.test.tsx +0 -201
- package/notes-app/src/components/IssueDetailView.tsx +0 -318
- package/notes-app/src/components/IssueList.test.tsx +0 -93
- package/notes-app/src/components/IssueList.tsx +0 -169
- package/notes-app/src/components/LabelSelector.tsx +0 -276
- package/notes-app/src/pages/LoginPage.test.tsx +0 -29
- package/stacks/django-vue.yaml +0 -33
- package/stacks/fastapi-react.yaml +0 -160
- package/stacks/flutter-firebase.yaml +0 -58
- package/stacks/nextjs-prisma.yaml +0 -33
- package/stacks/schema.json +0 -144
- package/templates/agents/architect.hbs +0 -183
- package/templates/agents/auto-documenter.hbs +0 -36
- package/templates/agents/backend-developer.hbs +0 -175
- package/templates/agents/code-reviewer.hbs +0 -29
- package/templates/agents/database-developer.hbs +0 -52
- package/templates/agents/debug-specialist.hbs +0 -39
- package/templates/agents/environment-setup.hbs +0 -41
- package/templates/agents/frontend-developer.hbs +0 -45
- package/templates/agents/integration-qa.hbs +0 -26
- package/templates/agents/performance-qa.hbs +0 -24
- package/templates/agents/pr-writer.hbs +0 -53
- package/templates/agents/quality-lead.hbs +0 -26
- package/templates/agents/requirements-analyst.hbs +0 -26
- package/templates/agents/security-analyst.hbs +0 -21
- package/templates/agents/security-reviewer.hbs +0 -20
- package/templates/agents/ssot-updater.hbs +0 -45
- package/templates/agents/technical-writer.hbs +0 -28
- package/templates/agents/unit-test-engineer.hbs +0 -19
- package/templates/agents/user-clone.hbs +0 -43
- package/templates/github-actions/aws/deploy-notes.yml.hbs +0 -117
- package/templates/github-actions/azure/deploy-notes.yml.hbs +0 -78
- package/templates/github-actions/gcp/deploy-notes.yml.hbs +0 -76
- package/templates/github-actions/vercel-railway/deploy-notes.yml.hbs +0 -49
- package/templates/mindsets/agent-stdio.hbs +0 -51
- package/templates/mindsets/dart.hbs +0 -39
- package/templates/mindsets/ddd-clean-architecture.hbs +0 -52
- package/templates/mindsets/electron.hbs +0 -41
- package/templates/mindsets/fastapi.hbs +0 -40
- package/templates/mindsets/flutter.hbs +0 -56
- package/templates/mindsets/kotlin.hbs +0 -46
- package/templates/mindsets/postgresql.hbs +0 -39
- package/templates/mindsets/python.hbs +0 -39
- package/templates/mindsets/react.hbs +0 -51
- package/templates/mindsets/swift.hbs +0 -46
- package/templates/mindsets/terraform.hbs +0 -53
- package/templates/mindsets/typescript.hbs +0 -34
- package/templates/mindsets/vite.hbs +0 -37
- package/templates/notes-compose.yml +0 -82
- package/templates/partials/cogito-geo.hbs +0 -84
- package/templates/partials/cogito-godd.hbs +0 -22
- package/templates/partials/cogito-grammar.hbs +0 -105
- package/templates/partials/cogito-particle.hbs +0 -76
- package/templates/partials/cogito-root-ai.hbs +0 -79
- package/templates/partials/cogito-root-arch.hbs +0 -75
- package/templates/partials/cogito-root-core.hbs +0 -75
- package/templates/partials/cogito-root-daily.hbs +0 -58
- package/templates/partials/cogito-root-dev.hbs +0 -71
- package/templates/partials/cogito-root-devops.hbs +0 -71
- package/templates/partials/cogito-root-framework.hbs +0 -80
- package/templates/partials/cogito-root-lang.hbs +0 -74
- package/templates/partials/godd-core.hbs +0 -50
- package/templates/partials/project-context.hbs +0 -52
- package/templates/partials/ssot-header.hbs +0 -40
- package/templates/partials/ssot-rules.hbs +0 -30
- package/templates/prompts/adr.hbs +0 -39
- package/templates/prompts/agent-dev-workflow.hbs +0 -34
- package/templates/prompts/analyze-report.hbs +0 -36
- package/templates/prompts/auto-documentation.hbs +0 -37
- package/templates/prompts/check.hbs +0 -52
- package/templates/prompts/commit.hbs +0 -96
- package/templates/prompts/dev.hbs +0 -127
- package/templates/prompts/docs-init.hbs +0 -101
- package/templates/prompts/docs-update.hbs +0 -51
- package/templates/prompts/git-workflow.hbs +0 -125
- package/templates/prompts/impact-analysis.hbs +0 -43
- package/templates/prompts/install.hbs +0 -40
- package/templates/prompts/new-branch.hbs +0 -61
- package/templates/prompts/notes-deploy.hbs +0 -138
- package/templates/prompts/pr-analyze.hbs +0 -44
- package/templates/prompts/pr-create.hbs +0 -125
- package/templates/prompts/push-execute.hbs +0 -83
- package/templates/prompts/push.hbs +0 -24
- package/templates/prompts/release-notes.hbs +0 -38
- package/templates/prompts/requirements-to-business-flow.hbs +0 -29
- package/templates/prompts/requirements-to-tickets.hbs +0 -26
- package/templates/prompts/review.hbs +0 -126
- package/templates/prompts/setup.hbs +0 -247
- package/templates/prompts/spec.hbs +0 -35
- package/templates/prompts/specification-to-tickets.hbs +0 -24
- package/templates/prompts/submit.hbs +0 -143
- package/templates/prompts/sync.hbs +0 -63
- package/templates/prompts/test-plan.hbs +0 -56
- package/templates/scripts/aws/terraform-backend-setup.sh.hbs +0 -149
- package/templates/terraform/aws/alb.tf.hbs +0 -58
- package/templates/terraform/aws/backend.tf.hbs +0 -10
- package/templates/terraform/aws/cloudfront.tf.hbs +0 -96
- package/templates/terraform/aws/ecr.tf.hbs +0 -30
- package/templates/terraform/aws/ecs.tf.hbs +0 -142
- package/templates/terraform/aws/iam.tf.hbs +0 -88
- package/templates/terraform/aws/local.tf.hbs +0 -34
- package/templates/terraform/aws/output.tf.hbs +0 -49
- package/templates/terraform/aws/provider.tf.hbs +0 -26
- package/templates/terraform/aws/rds.tf.hbs +0 -38
- package/templates/terraform/aws/s3.tf.hbs +0 -34
- package/templates/terraform/aws/secrets.tf.hbs +0 -53
- package/templates/terraform/aws/security_groups.tf.hbs +0 -81
- package/templates/terraform/aws/vpc.tf.hbs +0 -63
- package/templates/terraform/azure/backend.tf.hbs +0 -8
- package/templates/terraform/azure/iam.tf.hbs +0 -36
- package/templates/terraform/azure/main.tf.hbs +0 -203
- package/templates/terraform/azure/output.tf.hbs +0 -19
- package/templates/terraform/azure/provider.tf.hbs +0 -19
- package/templates/terraform/gcp/backend.tf.hbs +0 -6
- package/templates/terraform/gcp/iam.tf.hbs +0 -47
- package/templates/terraform/gcp/main.tf.hbs +0 -175
- package/templates/terraform/gcp/output.tf.hbs +0 -15
- package/templates/terraform/gcp/provider.tf.hbs +0 -19
- package/templates/terraform/vercel-railway/main.tf.hbs +0 -64
- package/templates/terraform/vercel-railway/output.tf.hbs +0 -11
- /package/{notes-api → notes/api}/.dockerignore +0 -0
- /package/{notes-api → notes/api}/alembic/README +0 -0
- /package/{notes-api → notes/api}/alembic/env.py +0 -0
- /package/{notes-api → notes/api}/alembic/script.py.mako +0 -0
- /package/{notes-api → notes/api}/alembic/versions/001_initial_notes_tables.py +0 -0
- /package/{notes-api → notes/api}/alembic/versions/002_add_performance_indexes.py +0 -0
- /package/{notes-api → notes/api}/alembic/versions/003_add_yjs_documents.py +0 -0
- /package/{notes-api → notes/api}/alembic/versions/004_add_comments.py +0 -0
- /package/{notes-api → notes/api}/alembic/versions/005_add_github_username.py +0 -0
- /package/{notes-api → notes/api}/alembic/versions/006_add_check_constraints.py +0 -0
- /package/{notes-api → notes/api}/alembic.ini +0 -0
- /package/{notes-api → notes/api}/app/__init__.py +0 -0
- /package/{notes-api → notes/api}/app/config.py +0 -0
- /package/{notes-api → notes/api}/app/database.py +0 -0
- /package/{notes-api → notes/api}/app/http_client.py +0 -0
- /package/{notes-api → notes/api}/app/models/__init__.py +0 -0
- /package/{notes-api → notes/api}/app/models/audit.py +0 -0
- /package/{notes-api → notes/api}/app/models/base.py +0 -0
- /package/{notes-api → notes/api}/app/models/collab.py +0 -0
- /package/{notes-api → notes/api}/app/models/comment.py +0 -0
- /package/{notes-api → notes/api}/app/models/session.py +0 -0
- /package/{notes-api → notes/api}/app/models/setting.py +0 -0
- /package/{notes-api → notes/api}/app/models/user.py +0 -0
- /package/{notes-api → notes/api}/app/path_validation.py +0 -0
- /package/{notes-api → notes/api}/app/routers/__init__.py +0 -0
- /package/{notes-api → notes/api}/app/routers/collab.py +0 -0
- /package/{notes-api → notes/api}/app/routers/comments.py +0 -0
- /package/{notes-api → notes/api}/app/routers/files.py +0 -0
- /package/{notes-api → notes/api}/app/routers/settings.py +0 -0
- /package/{notes-api → notes/api}/app/routers/tree.py +0 -0
- /package/{notes-api → notes/api}/app/routers/upload.py +0 -0
- /package/{notes-api → notes/api}/app/routers/users.py +0 -0
- /package/{notes-api → notes/api}/app/schemas/__init__.py +0 -0
- /package/{notes-api → notes/api}/app/schemas/auth.py +0 -0
- /package/{notes-api → notes/api}/app/schemas/user.py +0 -0
- /package/{notes-api → notes/api}/app/security.py +0 -0
- /package/{notes-api → notes/api}/app/services/__init__.py +0 -0
- /package/{notes-api → notes/api}/app/services/audit.py +0 -0
- /package/{notes-api → notes/api}/app/services/business_date.py +0 -0
- /package/{notes-api → notes/api}/app/services/collab.py +0 -0
- /package/{notes-api → notes/api}/app/services/github.py +0 -0
- /package/{notes-api → notes/api}/app/services/pr_chain.py +0 -0
- /package/{notes-api → notes/api}/app/startup.py +0 -0
- /package/{notes-api → notes/api}/docker/Dockerfile +0 -0
- /package/{notes-api → notes/api}/docker/Dockerfile.test +0 -0
- /package/{notes-api → notes/api}/pyproject.toml +0 -0
- /package/{notes-api → notes/api}/tests/conftest.py +0 -0
- /package/{notes-api → notes/api}/tests/test_audit.py +0 -0
- /package/{notes-api → notes/api}/tests/test_auth.py +0 -0
- /package/{notes-api → notes/api}/tests/test_business_date.py +0 -0
- /package/{notes-api → notes/api}/tests/test_collab.py +0 -0
- /package/{notes-api → notes/api}/tests/test_comments.py +0 -0
- /package/{notes-api → notes/api}/tests/test_config_ssl.py +0 -0
- /package/{notes-api → notes/api}/tests/test_config_warnings.py +0 -0
- /package/{notes-api → notes/api}/tests/test_files.py +0 -0
- /package/{notes-api → notes/api}/tests/test_path_validation.py +0 -0
- /package/{notes-api → notes/api}/tests/test_security.py +0 -0
- /package/{notes-api → notes/api}/tests/test_settings.py +0 -0
- /package/{notes-api → notes/api}/tests/test_tree.py +0 -0
- /package/{notes-api → notes/api}/tests/test_upload.py +0 -0
- /package/{notes-api → notes/api}/tests/test_users.py +0 -0
- /package/{notes-app → notes/app}/.dockerignore +0 -0
- /package/{notes-app → notes/app}/index.html +0 -0
- /package/{notes-app → notes/app}/nginx.conf +0 -0
- /package/{notes-app → notes/app}/package-lock.json +0 -0
- /package/{notes-app → notes/app}/playwright.config.ts +0 -0
- /package/{notes-app → notes/app}/pnpm-lock.yaml +0 -0
- /package/{notes-app → notes/app}/src/App.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/BranchSelectorModal.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/CodeBlockView.test.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/CodeBlockView.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/CollabStatus.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/DiffPreview.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/DrawioEditor.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/DrawioViewer.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/ErrorBoundary.test.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/ErrorBoundary.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/FileContentView.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/FileContextMenu.test.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/FileContextMenu.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/FileDialogs.test.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/FileDialogs.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/SaveStatusIndicator.test.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/SaveStatusIndicator.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/Skeleton.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/SpreadsheetEditor.test.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/SpreadsheetEditor.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/TextEditor.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/ToastContainer.tsx +0 -0
- /package/{notes-app → notes/app}/src/components/TreeNode.tsx +0 -0
- /package/{notes-app → notes/app}/src/contexts/AuthContext.test.tsx +0 -0
- /package/{notes-app → notes/app}/src/contexts/AuthContext.tsx +0 -0
- /package/{notes-app → notes/app}/src/contexts/ToastContext.test.ts +0 -0
- /package/{notes-app → notes/app}/src/contexts/ToastContext.tsx +0 -0
- /package/{notes-app → notes/app}/src/hooks/useAutoSave.test.ts +0 -0
- /package/{notes-app → notes/app}/src/hooks/useAutoSave.ts +0 -0
- /package/{notes-app → notes/app}/src/hooks/useCollaboration.ts +0 -0
- /package/{notes-app → notes/app}/src/hooks/useComments.ts +0 -0
- /package/{notes-app → notes/app}/src/hooks/useYText.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/branch-diff.test.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/branch-diff.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/created-file.test.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/created-file.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/csv-utils.test.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/csv-utils.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/deepLinkPathToSearch.test.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/deepLinkPathToSearch.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/draft-storage.test.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/draft-storage.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/mermaid-render.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/postLoginRedirect.test.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/postLoginRedirect.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/tree-utils.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/user-colors.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/xlsx-utils.test.ts +0 -0
- /package/{notes-app → notes/app}/src/lib/xlsx-utils.ts +0 -0
- /package/{notes-app → notes/app}/src/main.tsx +0 -0
- /package/{notes-app → notes/app}/src/pages/LoginPage.tsx +0 -0
- /package/{notes-app → notes/app}/src/pages/MainPage.insertChildEntry.test.ts +0 -0
- /package/{notes-app → notes/app}/src/pages/SettingsPage.tsx +0 -0
- /package/{notes-app → notes/app}/src/pages/UserManagementPage.tsx +0 -0
- /package/{notes-app → notes/app}/src/styles/globals.css +0 -0
- /package/{notes-app → notes/app}/src/types.ts +0 -0
- /package/{notes-app → notes/app}/src/vite-env.d.ts +0 -0
- /package/{notes-app → notes/app}/tsconfig.json +0 -0
- /package/{notes-app → notes/app}/tsconfig.node.json +0 -0
- /package/{notes-app → notes/app}/vite.config.js +0 -0
- /package/{notes-app → notes/app}/vite.config.ts +0 -0
- /package/{notes-app → notes/app}/vitest.config.ts +0 -0
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import { screen, waitFor, fireEvent, within } from "@testing-library/react";
|
|
3
|
+
import {
|
|
4
|
+
jsonResponse,
|
|
5
|
+
mockAuthContext,
|
|
6
|
+
mockAutoSave,
|
|
7
|
+
mockCollaboration,
|
|
8
|
+
mockComments,
|
|
9
|
+
mockEditSession,
|
|
10
|
+
mockMatchMedia,
|
|
11
|
+
} from "@/test/mocks";
|
|
12
|
+
import { renderWithProviders } from "@/test/render";
|
|
13
|
+
|
|
14
|
+
const mockApiFetch = vi.hoisted(() => vi.fn());
|
|
15
|
+
const mockFetchProposalsApi = vi.hoisted(() => vi.fn());
|
|
16
|
+
const mockGetWindowSelectionAnchor = vi.hoisted(() => vi.fn());
|
|
17
|
+
|
|
18
|
+
vi.mock("@/lib/api", async (importOriginal) => {
|
|
19
|
+
const actual = await importOriginal<typeof import("@/lib/api")>();
|
|
20
|
+
return {
|
|
21
|
+
...actual,
|
|
22
|
+
apiFetch: (...args: unknown[]) => mockApiFetch(...args),
|
|
23
|
+
fetchProposalsApi: () => mockFetchProposalsApi(),
|
|
24
|
+
// getErrorMessage / isAbortError は純粋関数のため実体(...actual)をそのまま使う
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
vi.mock("@/contexts/AuthContext", () => ({ useAuth: () => mockAuthContext() }));
|
|
29
|
+
vi.mock("@/hooks/useEditSession", () => ({ useEditSession: () => mockEditSession() }));
|
|
30
|
+
vi.mock("@/hooks/useAutoSave", () => ({ useAutoSave: () => mockAutoSave() }));
|
|
31
|
+
vi.mock("@/hooks/useCollaboration", () => ({
|
|
32
|
+
useCollaboration: () => mockCollaboration(),
|
|
33
|
+
}));
|
|
34
|
+
vi.mock("@/hooks/useComments", () => ({ useComments: () => mockComments() }));
|
|
35
|
+
|
|
36
|
+
vi.mock("@/lib/commentAnchor", async (importOriginal) => {
|
|
37
|
+
const actual = await importOriginal<typeof import("@/lib/commentAnchor")>();
|
|
38
|
+
return {
|
|
39
|
+
...actual,
|
|
40
|
+
getWindowSelectionAnchor: (...args: unknown[]) => mockGetWindowSelectionAnchor(...args),
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
import MainPage from "./MainPage";
|
|
45
|
+
|
|
46
|
+
const sampleFileContent = {
|
|
47
|
+
path: "docs/readme.md",
|
|
48
|
+
content: "# Hello",
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
function mockTreeAndFileApi() {
|
|
52
|
+
mockApiFetch.mockImplementation((url: string) => {
|
|
53
|
+
if (url.startsWith("/tree")) {
|
|
54
|
+
return Promise.resolve(
|
|
55
|
+
jsonResponse([
|
|
56
|
+
{
|
|
57
|
+
name: "docs",
|
|
58
|
+
path: "docs",
|
|
59
|
+
type: "dir",
|
|
60
|
+
children: [{ name: "readme.md", path: "docs/readme.md", type: "file" }],
|
|
61
|
+
},
|
|
62
|
+
]),
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
if (url.startsWith("/files/docs/readme.md")) {
|
|
66
|
+
return Promise.resolve(jsonResponse(sampleFileContent));
|
|
67
|
+
}
|
|
68
|
+
return Promise.resolve({ ok: false, status: 404, headers: { get: () => null } });
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function renderMainPage(initialEntry = "/") {
|
|
73
|
+
return renderWithProviders(<MainPage />, { initialEntries: [initialEntry] });
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function mockTextSelection() {
|
|
77
|
+
const mockRange = {
|
|
78
|
+
getBoundingClientRect: () => ({
|
|
79
|
+
top: 100,
|
|
80
|
+
left: 50,
|
|
81
|
+
width: 80,
|
|
82
|
+
height: 20,
|
|
83
|
+
right: 130,
|
|
84
|
+
bottom: 120,
|
|
85
|
+
x: 50,
|
|
86
|
+
y: 100,
|
|
87
|
+
toJSON: () => ({}),
|
|
88
|
+
}),
|
|
89
|
+
};
|
|
90
|
+
mockGetWindowSelectionAnchor.mockReturnValue({
|
|
91
|
+
anchor_text: "selected snippet",
|
|
92
|
+
position_from: 2,
|
|
93
|
+
position_to: 7,
|
|
94
|
+
});
|
|
95
|
+
Object.defineProperty(window, "getSelection", {
|
|
96
|
+
writable: true,
|
|
97
|
+
configurable: true,
|
|
98
|
+
value: vi.fn(() => ({
|
|
99
|
+
isCollapsed: false,
|
|
100
|
+
rangeCount: 1,
|
|
101
|
+
getRangeAt: () => mockRange,
|
|
102
|
+
})),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
describe("MainPage — left sidebar layout", () => {
|
|
107
|
+
beforeEach(() => {
|
|
108
|
+
vi.clearAllMocks();
|
|
109
|
+
mockMatchMedia(true);
|
|
110
|
+
mockFetchProposalsApi.mockResolvedValue([]);
|
|
111
|
+
mockApiFetch.mockImplementation((url: string) => {
|
|
112
|
+
if (url.startsWith("/tree")) {
|
|
113
|
+
return Promise.resolve(jsonResponse([]));
|
|
114
|
+
}
|
|
115
|
+
return Promise.resolve({ ok: false, status: 404, headers: { get: () => null } });
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("md+ 用に左サイドバー aside を relative 配置する", async () => {
|
|
120
|
+
renderMainPage();
|
|
121
|
+
|
|
122
|
+
const aside = await waitFor(() => screen.getByTestId("left-sidebar"));
|
|
123
|
+
expect(aside.className).toContain("md:relative");
|
|
124
|
+
expect(aside.className).not.toContain("md:static");
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it("REQ-UI-AC-01: md+ に左サイドバーリサイズスライダーが存在する", async () => {
|
|
128
|
+
renderMainPage();
|
|
129
|
+
|
|
130
|
+
await waitFor(() => screen.getByTestId("left-sidebar"));
|
|
131
|
+
expect(
|
|
132
|
+
screen.getByRole("slider", { name: "左サイドバーの幅を変更" }),
|
|
133
|
+
).toBeTruthy();
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
describe("MainPage — right panel mutual exclusivity", () => {
|
|
138
|
+
const originalGetSelection = window.getSelection;
|
|
139
|
+
|
|
140
|
+
beforeEach(() => {
|
|
141
|
+
vi.clearAllMocks();
|
|
142
|
+
mockMatchMedia(true);
|
|
143
|
+
mockFetchProposalsApi.mockResolvedValue([]);
|
|
144
|
+
mockTreeAndFileApi();
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
afterEach(() => {
|
|
148
|
+
Object.defineProperty(window, "getSelection", {
|
|
149
|
+
writable: true,
|
|
150
|
+
configurable: true,
|
|
151
|
+
value: originalGetSelection,
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
it("コメントパネル表示中にファイル情報パネルを開くとコメントパネルが閉じる", async () => {
|
|
156
|
+
renderMainPage("/?file=docs/readme.md");
|
|
157
|
+
|
|
158
|
+
const commentToggle = await waitFor(() =>
|
|
159
|
+
screen.getByTitle("コメントパネルを表示/非表示"),
|
|
160
|
+
);
|
|
161
|
+
fireEvent.click(commentToggle);
|
|
162
|
+
|
|
163
|
+
expect(await screen.findByRole("heading", { name: /^コメント/ })).toBeTruthy();
|
|
164
|
+
|
|
165
|
+
const fileInfoToggle = screen.getByTitle("ファイル情報パネルを表示/非表示");
|
|
166
|
+
fireEvent.click(fileInfoToggle);
|
|
167
|
+
|
|
168
|
+
expect(await screen.findByRole("heading", { name: "ファイル情報" })).toBeTruthy();
|
|
169
|
+
expect(screen.queryByRole("heading", { name: /^コメント/ })).toBeNull();
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it("ファイル情報パネル表示中にコメントパネルを開くとファイル情報パネルが閉じる", async () => {
|
|
173
|
+
renderMainPage("/?file=docs/readme.md");
|
|
174
|
+
|
|
175
|
+
const fileInfoToggle = await waitFor(() =>
|
|
176
|
+
screen.getByTitle("ファイル情報パネルを表示/非表示"),
|
|
177
|
+
);
|
|
178
|
+
fireEvent.click(fileInfoToggle);
|
|
179
|
+
|
|
180
|
+
expect(await screen.findByRole("heading", { name: "ファイル情報" })).toBeTruthy();
|
|
181
|
+
|
|
182
|
+
const commentToggle = screen.getByTitle("コメントパネルを表示/非表示");
|
|
183
|
+
fireEvent.click(commentToggle);
|
|
184
|
+
|
|
185
|
+
expect(await screen.findByRole("heading", { name: /^コメント/ })).toBeTruthy();
|
|
186
|
+
expect(screen.queryByRole("heading", { name: "ファイル情報" })).toBeNull();
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it("閲覧モードのテキスト選択からコメント追加するとファイル情報パネルが閉じる", async () => {
|
|
190
|
+
renderMainPage("/?file=docs/readme.md");
|
|
191
|
+
mockTextSelection();
|
|
192
|
+
|
|
193
|
+
const fileInfoToggle = await waitFor(() =>
|
|
194
|
+
screen.getByTitle("ファイル情報パネルを表示/非表示"),
|
|
195
|
+
);
|
|
196
|
+
fireEvent.click(fileInfoToggle);
|
|
197
|
+
expect(await screen.findByRole("heading", { name: "ファイル情報" })).toBeTruthy();
|
|
198
|
+
|
|
199
|
+
const content = await screen.findByText(/Hello/);
|
|
200
|
+
fireEvent.mouseUp(content);
|
|
201
|
+
|
|
202
|
+
expect(mockGetWindowSelectionAnchor).toHaveBeenCalled();
|
|
203
|
+
|
|
204
|
+
const addCommentBtn = await screen.findByRole("button", { name: "コメント" });
|
|
205
|
+
fireEvent.click(addCommentBtn);
|
|
206
|
+
|
|
207
|
+
expect(await screen.findByRole("heading", { name: /^コメント/ })).toBeTruthy();
|
|
208
|
+
expect(screen.queryByRole("heading", { name: "ファイル情報" })).toBeNull();
|
|
209
|
+
expect(screen.getByText("selected snippet")).toBeTruthy();
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
describe("MainPage — showOriginal slider deduplication", () => {
|
|
214
|
+
beforeEach(() => {
|
|
215
|
+
vi.clearAllMocks();
|
|
216
|
+
mockMatchMedia(true);
|
|
217
|
+
mockFetchProposalsApi.mockResolvedValue([]);
|
|
218
|
+
mockTreeAndFileApi();
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
async function enterEditModeWithOriginal(
|
|
222
|
+
secondaryPanel: "comment" | "fileInfo",
|
|
223
|
+
) {
|
|
224
|
+
renderMainPage("/?file=docs/readme.md");
|
|
225
|
+
|
|
226
|
+
const editBtn = await waitFor(() => screen.getByRole("button", { name: "編集" }));
|
|
227
|
+
fireEvent.click(editBtn);
|
|
228
|
+
|
|
229
|
+
const showOriginalBtn = await waitFor(() =>
|
|
230
|
+
screen.getByRole("button", { name: /base: main/ }),
|
|
231
|
+
);
|
|
232
|
+
fireEvent.click(showOriginalBtn);
|
|
233
|
+
expect(await screen.findByRole("heading", { name: /main のソース/ })).toBeTruthy();
|
|
234
|
+
|
|
235
|
+
if (secondaryPanel === "comment") {
|
|
236
|
+
fireEvent.click(screen.getByTitle("コメントパネルを表示/非表示"));
|
|
237
|
+
expect(await screen.findByRole("heading", { name: /^コメント/ })).toBeTruthy();
|
|
238
|
+
} else {
|
|
239
|
+
fireEvent.click(screen.getByTitle("ファイル情報パネルを表示/非表示"));
|
|
240
|
+
expect(await screen.findByRole("heading", { name: "ファイル情報" })).toBeTruthy();
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
it("showOriginal + コメント同時表示時は右パネルの slider は参照パネルのみ", async () => {
|
|
245
|
+
await enterEditModeWithOriginal("comment");
|
|
246
|
+
|
|
247
|
+
expect(
|
|
248
|
+
screen.getByRole("slider", { name: "参照パネルの幅を変更" }),
|
|
249
|
+
).toBeTruthy();
|
|
250
|
+
expect(screen.queryByRole("slider", { name: "コメントパネルの幅を変更" })).toBeNull();
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
it("showOriginal + ファイル情報同時表示時は右パネルの slider は参照パネルのみ", async () => {
|
|
254
|
+
await enterEditModeWithOriginal("fileInfo");
|
|
255
|
+
|
|
256
|
+
expect(
|
|
257
|
+
screen.getByRole("slider", { name: "参照パネルの幅を変更" }),
|
|
258
|
+
).toBeTruthy();
|
|
259
|
+
expect(screen.queryByRole("slider", { name: "ファイル情報パネルの幅を変更" })).toBeNull();
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
async function closeOriginalPanel() {
|
|
263
|
+
const originalHeading = screen.getByRole("heading", { name: /main のソース/ });
|
|
264
|
+
const originalAside = originalHeading.closest("aside");
|
|
265
|
+
expect(originalAside).toBeTruthy();
|
|
266
|
+
fireEvent.click(
|
|
267
|
+
within(originalAside as HTMLElement).getByRole("button", { name: "閉じる" }),
|
|
268
|
+
);
|
|
269
|
+
await waitFor(() => {
|
|
270
|
+
expect(screen.queryByRole("heading", { name: /main のソース/ })).toBeNull();
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
it("showOriginal を閉じるとコメントパネル側の slider が復帰する", async () => {
|
|
275
|
+
await enterEditModeWithOriginal("comment");
|
|
276
|
+
await closeOriginalPanel();
|
|
277
|
+
|
|
278
|
+
expect(
|
|
279
|
+
screen.getByRole("slider", { name: "コメントパネルの幅を変更" }),
|
|
280
|
+
).toBeTruthy();
|
|
281
|
+
expect(screen.queryByRole("slider", { name: "参照パネルの幅を変更" })).toBeNull();
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it("showOriginal を閉じるとファイル情報パネル側の slider が復帰する", async () => {
|
|
285
|
+
await enterEditModeWithOriginal("fileInfo");
|
|
286
|
+
await closeOriginalPanel();
|
|
287
|
+
|
|
288
|
+
expect(
|
|
289
|
+
screen.getByRole("slider", { name: "ファイル情報パネルの幅を変更" }),
|
|
290
|
+
).toBeTruthy();
|
|
291
|
+
expect(screen.queryByRole("slider", { name: "参照パネルの幅を変更" })).toBeNull();
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
describe("MainPage — showOriginal branch switch reset", () => {
|
|
296
|
+
beforeEach(() => {
|
|
297
|
+
vi.clearAllMocks();
|
|
298
|
+
HTMLDialogElement.prototype.showModal = vi.fn(function (this: HTMLDialogElement) {
|
|
299
|
+
this.open = true;
|
|
300
|
+
});
|
|
301
|
+
HTMLDialogElement.prototype.close = vi.fn(function (this: HTMLDialogElement) {
|
|
302
|
+
this.open = false;
|
|
303
|
+
});
|
|
304
|
+
mockMatchMedia(true);
|
|
305
|
+
mockFetchProposalsApi.mockResolvedValue([
|
|
306
|
+
{
|
|
307
|
+
number: 42,
|
|
308
|
+
title: "Test branch PR",
|
|
309
|
+
branch: "feat/test-branch",
|
|
310
|
+
author: "alice",
|
|
311
|
+
state: "open",
|
|
312
|
+
merged: false,
|
|
313
|
+
createdAt: "2026-06-01T00:00:00Z",
|
|
314
|
+
updatedAt: "2026-06-01T00:00:00Z",
|
|
315
|
+
url: "https://github.com/ripla-inc/GoDD/pull/42",
|
|
316
|
+
draft: false,
|
|
317
|
+
},
|
|
318
|
+
]);
|
|
319
|
+
mockTreeAndFileApi();
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
async function openOriginalInEditMode() {
|
|
323
|
+
renderMainPage("/?file=docs/readme.md");
|
|
324
|
+
fireEvent.click(await waitFor(() => screen.getByRole("button", { name: "編集" })));
|
|
325
|
+
fireEvent.click(await waitFor(() => screen.getByRole("button", { name: /base: main/ })));
|
|
326
|
+
expect(await screen.findByRole("heading", { name: /main のソース/ })).toBeTruthy();
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
async function switchToTestBranch() {
|
|
330
|
+
const sidebar = screen.getByTestId("left-sidebar");
|
|
331
|
+
fireEvent.click(within(sidebar).getByRole("button", { name: "main" }));
|
|
332
|
+
fireEvent.click(await screen.findByRole("button", { name: /Test branch PR/ }));
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
it("ブランチ切替直後に原文パネルが閉じる", async () => {
|
|
336
|
+
await openOriginalInEditMode();
|
|
337
|
+
await switchToTestBranch();
|
|
338
|
+
|
|
339
|
+
await waitFor(() => {
|
|
340
|
+
expect(screen.queryByRole("heading", { name: /main のソース/ })).toBeNull();
|
|
341
|
+
});
|
|
342
|
+
expect(screen.queryByRole("button", { name: /base: main/ })).toBeNull();
|
|
343
|
+
expect(screen.getByText("ファイルまたは Issue を選択してください")).toBeTruthy();
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
it("ブランチ切替後に原文パネルが自動復帰しない", async () => {
|
|
347
|
+
await openOriginalInEditMode();
|
|
348
|
+
await switchToTestBranch();
|
|
349
|
+
|
|
350
|
+
await waitFor(() => {
|
|
351
|
+
expect(screen.getByText("ファイルまたは Issue を選択してください")).toBeTruthy();
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
fireEvent.click(await waitFor(() => screen.getByText("docs")));
|
|
355
|
+
fireEvent.click(await screen.findByText("readme.md"));
|
|
356
|
+
await waitFor(() => expect(screen.getByText(/Hello/)).toBeTruthy());
|
|
357
|
+
|
|
358
|
+
fireEvent.click(screen.getByRole("button", { name: "編集" }));
|
|
359
|
+
expect(screen.queryByRole("heading", { name: /main のソース/ })).toBeNull();
|
|
360
|
+
});
|
|
361
|
+
});
|