Skip to content

Refine public docs and React ownership - #1

Merged
zgq354-code merged 15 commits into
mainfrom
docs/fret-readme
Aug 24, 2026
Merged

zgq354-code merged 15 commits into
mainfrom
docs/fret-readme

Conversation

@zgq354-code

Copy link
Copy Markdown
Collaborator

Outcome

Make Fret & Key easier to understand as a public work and establish clearer ownership boundaries before the next source-layout migration.

What changed

  • Rewrite the Chinese product README and add an English counterpart.
  • Add the maintainer-facing agent guide and technical architecture overview.
  • Move unit and browser tests into the top-level test tree.
  • Extract the learning, fretboard, keyboard, and notation panels from the application root.
  • Move persistence, browser subscriptions, listening history, and resource lifecycle hooks into owner-local React adapters.
  • Keep App.tsx as the explicit composition root while removing direct effect ownership.

Explicitly preserved

  • Product behavior, browser storage keys, Local Edge release behavior, and deployment boundaries remain unchanged.
  • Audio, MIDI, playback, music-theory, settings, and platform owners remain independently testable.

Non-goals

  • This PR does not introduce the planned modules directory or complete the next App.tsx decomposition. That migration will start from main after this PR is reviewed and merged.
  • It does not open external contributions or change production deployment policy.

Risk and review notes

The test-directory move inflates the file count but is isolated in its own commit. The main behavior-sensitive areas are learning-mode transitions, microphone and playback lifecycle cleanup, persisted preference compatibility, and pointer glissando behavior.

Verification

  • pnpm run ci
  • 23 test files / 104 tests passed
  • Local Edge E2E: 4 passed / 1 expected skip
  • lint, typecheck, build, PWA, and site metadata checks passed

@zgq354

zgq354 commented Aug 24, 2026

Copy link
Copy Markdown
Owner

@codex review this

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

馃挕 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f39bc0d490

鈩癸笍 About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 馃憤.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 1 to +2
import { describe, expect, it } from 'vitest'
import { AudioSampleRing } from './audioSampleRing'
import { AudioSampleRing } from '../../src/audio/audioSampleRing'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include the relocated tests in a TypeScript project

Moving the specs under tests/ takes them outside both TypeScript projects: tsconfig.app.json includes only src, while tsconfig.node.json still includes the now-deleted e2e directory. As a result, the tsc -b command behind pnpm typecheck no longer checks any unit or Playwright spec, allowing type-invalid test fixtures and API usage to pass that CI stage; include tests/ in an appropriate project or add a dedicated test tsconfig.

AGENTS.md reference: AGENTS.md:L46-L49

Useful? React with 馃憤聽/ 馃憥.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 8202c63. Added a dedicated tsconfig.test.json project, referenced it from the root build, and removed the stale e2e include. I also verified the coverage by temporarily introducing a type error under tests/: pnpm typecheck failed with TS2322 before the probe was removed. Full pnpm run ci passes.

Comment thread docs/architecture.md Outdated
Comment on lines +25 to +27
For monophonic listening, `audio/usePitchDetection.ts` captures microphone samples through the Web Audio API, estimates a frequency, and converts it to a `PitchReading` through `music`.

For experimental polyphonic listening, `audio/usePolyphonicPitchDetection.ts` captures PCM through the public AudioWorklet, maintains a bounded sample ring, and sends analysis work to a Worker. The Worker loads Basic Pitch and returns note candidates; `music/chordAnalysis.ts` turns a result into a displayable chord reading. The feature is intentionally not source separation or continuous-song transcription.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update architecture paths to the new React adapters

The documented files audio/usePitchDetection.ts and audio/usePolyphonicPitchDetection.ts no longer exist after this commit; their implementations were moved under src/audio/react/. The same stale-path problem occurs for the learning, playback, and MIDI hooks on line 31, so the new maintainer-facing runtime guide directs readers to five removed files and obscures the ownership layout it is intended to document.

AGENTS.md reference: AGENTS.md:L7-L9

Useful? React with 馃憤聽/ 馃憥.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in 8202c63. Updated all five hook references to their owner-local react/ paths in docs/architecture.md.

@zgq354

zgq354 commented Aug 24, 2026

Copy link
Copy Markdown
Owner

@codex review this

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 8202c63bd4

鈩癸笍 About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 馃憤.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@zgq354 zgq354 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed the current head after CI and the follow-up Codex review. The test typecheck gap and stale architecture paths are fixed in 8202c63.

@zgq354-code
zgq354-code merged commit e859cb9 into main Aug 24, 2026
2 checks passed
@zgq354-code
zgq354-code deleted the docs/fret-readme branch August 24, 2026 12:46
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.

2 participants