Skip to content

Refacto : rename fileName to filename and introduce a new json load fun - #522

Merged
Babali42 merged 2 commits into
mainfrom
rename-fileName-to-filename
Aug 11, 2026
Merged

Refacto : rename fileName to filename and introduce a new json load fun#522
Babali42 merged 2 commits into
mainfrom
rename-fileName-to-filename

Conversation

@Babali42

@Babali42 Babali42 commented Aug 11, 2026

Copy link
Copy Markdown
Owner

…d function in types

Summary by CodeRabbit

  • New Features
    • Added beat lookup by audio filename to support selecting and loading individual beats.
  • Updates
    • Standardized track and export filename fields across beat data, audio playback, MIDI/audio exports, and engine integration.
    • Updated export dialogs and localized labels to use the consistent “filename” field.
  • Bug Fixes
    • Improved consistency when loading track audio and resolving beat assets by filename.
  • Tests
    • Updated playback, sequencer, beat-loading, and export coverage for the standardized filename format.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Babali42, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 29bd0c62-dc50-4abe-802b-8e2e72ecd3fc

📥 Commits

Reviewing files that changed from the base of the PR and between 51b3a6c and fba914e.

📒 Files selected for processing (1)
  • frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.service.ts
📝 Walkthrough

Walkthrough

The PR standardizes fileName to filename across track models, serialization, beat assets, audio and MIDI export flows, localization keys, and tests. It also adds filename-based beat lookup interfaces and adapter methods.

Changes

Filename Property Consistency

Layer / File(s) Summary
Filename contracts and serialization
engine/src/main/scala/.../Track.scala, frontend/src/app/domain/..., frontend/src/types/engine.d.ts
Public track, export option, compact track, and engine contracts use filename. Scala.js parsing and serialization use the renamed property.
Beat lookup and mapping
frontend/src/app/infrastructure/adapters/beat-source/...
Beat lookup interfaces and adapters add filename-based loading. Compact beat mapping, deduplication, fixtures, and reader contracts use filename.
Audio and sequencer integrations
frontend/src/app/infrastructure/adapters/audio-*/..., frontend/src/app/ui/components/sequencer/..., frontend/src/app/ui/services/sequencer/...
Audio loading, playback, track construction, beat selection, downloads, and test fixtures read filename.
Export forms and localization
frontend/src/app/ui/components/modals/export-*/..., frontend/src/assets/i18n/*
Audio and MIDI export forms, validation, emitted payloads, tests, and translation keys use filename.
Beat asset schema updates
frontend/src/assets/beats/*/*.json
Beat track records use filename while preserving audio paths and sequencing data.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately identifies the two main changes: renaming fileName to filename and adding JSON loading functionality.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rename-fileName-to-filename

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Babali42 Babali42 changed the title Refacto : rename fileName to filename and introduce the mono json loa… Refacto : rename fileName to filename and introduce a new json load fun Aug 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
frontend/src/app/infrastructure/adapters/beat-source/beat-adapter.service.spec.ts (1)

12-13: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Make the lookup mock honor its filename argument.

This stub returns the same beat for every fileName. Tests for BeatAdapter.getBeatByFileName can therefore pass when the adapter forwards the wrong name. Return the fixture only for the expected asset path and return Option.none() for unknown files.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/src/app/infrastructure/adapters/beat-source/beat-adapter.service.spec.ts`
around lines 12 - 13, Update the loadJsonByFileName mock to inspect its fileName
argument, returning the existing CompactBeat fixture only for the expected asset
path and Option.none() for all other filenames, so BeatAdapter.getBeatByFileName
tests validate the forwarded name.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@frontend/src/app/infrastructure/adapters/beat-source/beat-adapter.service.spec.ts`:
- Line 30: Update both fixture path references in the beat adapter service spec
to use metal/crash.mp3 via toMp3FilePath, replacing the misspelled
metal/carsh.mp3 value and preserving the matching asset path.

In
`@frontend/src/app/infrastructure/adapters/beat-source/beat-adapter.service.ts`:
- Around line 16-20: Update getBeatByFileName to handle the Option returned by
loadJsonByFileName without throwing: check Option.isNone(beat), return
Effect.fail with an Error for None, and call
CompactBeatMapper.toBeatEffect(beat.value) only for Some values.

In
`@frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.service.ts`:
- Around line 13-15: Implement JsonFilesReaderService.loadJsonByFileName by
normalizing the filename to remove an optional .json suffix, delegating to
loadAllBeats (which appends the suffix), and returning the matching beat as an
Effect<Option<CompactBeat>, never> instead of throwing. Preserve Option.none
when no beat matches.

In `@frontend/src/app/ui/components/sequencer/sequencer.component.ts`:
- Line 238: Update the export tests for both handlers in the sequencer component
spec to provide valid filename values in their options, then assert that
downloadBlob is called with the corresponding blob and filename. Cover both
handler paths so the options.filename rename is verified and no test invokes
them with an empty options object.

---

Nitpick comments:
In
`@frontend/src/app/infrastructure/adapters/beat-source/beat-adapter.service.spec.ts`:
- Around line 12-13: Update the loadJsonByFileName mock to inspect its fileName
argument, returning the existing CompactBeat fixture only for the expected asset
path and Option.none() for all other filenames, so BeatAdapter.getBeatByFileName
tests validate the forwarded name.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 44cafea8-7820-4188-b481-eaaa581b0d9e

📥 Commits

Reviewing files that changed from the base of the PR and between 74c70bf and 51b3a6c.

📒 Files selected for processing (64)
  • .devcontainer/scala-container/devcontainer-lock.json
  • engine/src/main/scala/com/drumbeatrepo/sequencer/Track.scala
  • engine/src/test/scala/com/drumbeatrepo/sequencer/SequencerStateTest.scala
  • frontend/src/app/domain/export-options/audio-export-options.ts
  • frontend/src/app/domain/export-options/midi-export-options.ts
  • frontend/src/app/domain/ports/i-manage-beats.ts
  • frontend/src/app/domain/track.ts
  • frontend/src/app/infrastructure/adapters/audio-engine/audio-engine.adapter.spec.ts
  • frontend/src/app/infrastructure/adapters/audio-engine/audio-engine.adapter.ts
  • frontend/src/app/infrastructure/adapters/audio-export/audio-export.adapter.ts
  • frontend/src/app/infrastructure/adapters/beat-source/beat-adapter.service.spec.ts
  • frontend/src/app/infrastructure/adapters/beat-source/beat-adapter.service.ts
  • frontend/src/app/infrastructure/adapters/beat-source/compact-beat.mapper.spec.ts
  • frontend/src/app/infrastructure/adapters/beat-source/compact-beat.mapper.ts
  • frontend/src/app/infrastructure/adapters/beat-source/compact-track.ts
  • frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.interface.ts
  • frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.service.spec.ts
  • frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.service.ts
  • frontend/src/app/ui/components/modals/export-audio-modal/export-audio-modal.component.html
  • frontend/src/app/ui/components/modals/export-audio-modal/export-audio-modal.component.spec.ts
  • frontend/src/app/ui/components/modals/export-audio-modal/export-audio-modal.component.ts
  • frontend/src/app/ui/components/modals/export-midi-modal/export-midi-modal.component.html
  • frontend/src/app/ui/components/modals/export-midi-modal/export-midi-modal.component.spec.ts
  • frontend/src/app/ui/components/modals/export-midi-modal/export-midi-modal.component.ts
  • frontend/src/app/ui/components/sequencer/sequencer.component.spec.ts
  • frontend/src/app/ui/components/sequencer/sequencer.component.ts
  • frontend/src/app/ui/services/sequencer/sequencer.service.spec.ts
  • frontend/src/app/ui/services/sequencer/sequencer.service.ts
  • frontend/src/assets/beats/dancehall/modern.json
  • frontend/src/assets/beats/dancehall/reggaeton.json
  • frontend/src/assets/beats/dancehall/standard.json
  • frontend/src/assets/beats/dnb/dnb.json
  • frontend/src/assets/beats/dub/dub.json
  • frontend/src/assets/beats/ebm/ebm.json
  • frontend/src/assets/beats/hardcore-techno/gabber.json
  • frontend/src/assets/beats/hip-hop/jul.json
  • frontend/src/assets/beats/hip-hop/trap.json
  • frontend/src/assets/beats/hypnotic-techno/son-clave.json
  • frontend/src/assets/beats/hypnotic-techno/tresillo.json
  • frontend/src/assets/beats/jersey-club/jersey-club.json
  • frontend/src/assets/beats/metal/half-time-groove.json
  • frontend/src/assets/beats/metal/metal-blastbeat.json
  • frontend/src/assets/beats/metal/metal.json
  • frontend/src/assets/beats/psytrance/psytrance-ternary.json
  • frontend/src/assets/beats/psytrance/psytrance-variation.json
  • frontend/src/assets/beats/psytrance/psytrance.json
  • frontend/src/assets/beats/punk/punk-beat-eight-note-fill.json
  • frontend/src/assets/beats/punk/punk-beat-quarter-note-groove-variation.json
  • frontend/src/assets/beats/punk/punk-beat-quarter-note-groove.json
  • frontend/src/assets/beats/rock/rock.json
  • frontend/src/assets/beats/rock/variation.json
  • frontend/src/assets/beats/techno/off-beat-clap.json
  • frontend/src/assets/beats/techno/techno.json
  • frontend/src/assets/i18n/ar.json
  • frontend/src/assets/i18n/de.json
  • frontend/src/assets/i18n/en.json
  • frontend/src/assets/i18n/es.json
  • frontend/src/assets/i18n/fr.json
  • frontend/src/assets/i18n/it.json
  • frontend/src/assets/i18n/ja.json
  • frontend/src/assets/i18n/pt.json
  • frontend/src/assets/i18n/ru.json
  • frontend/src/assets/i18n/zh.json
  • frontend/src/types/engine.d.ts

{
"name": "Hats",
"midiNote": 38,
"filename": toMp3FilePath("metal/carsh.mp3"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

rg -n -C 2 'carsh\.mp3|crash\.mp3' frontend

Repository: Babali42/DrumBeatRepo

Length of output: 3336


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- matching asset files ---'
find frontend/src/assets -type f \( -iname '*crash*.mp3' -o -iname '*carsh*.mp3' \) -print 2>/dev/null || true
printf '%s\n' '--- beat adapter spec ---'
cat -n frontend/src/app/infrastructure/adapters/beat-source/beat-adapter.service.spec.ts
printf '%s\n' '--- path helper and reader references ---'
rg -n -C 3 'toMp3FilePath|loadJsonByFileName|metal/(carsh|crash)\.mp3' frontend/src/app frontend/src/assets

Repository: Babali42/DrumBeatRepo

Length of output: 26069


Correct both fixture paths to metal/crash.mp3. The only matching asset is frontend/src/assets/sounds/metal/crash.mp3; carsh.mp3 does not exist.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/src/app/infrastructure/adapters/beat-source/beat-adapter.service.spec.ts`
at line 30, Update both fixture path references in the beat adapter service spec
to use metal/crash.mp3 via toMp3FilePath, replacing the misspelled
metal/carsh.mp3 value and preserving the matching asset path.

Comment on lines +16 to +20
getBeatByFileName(name: string): Effect.Effect<Beat, Error> {
return Effect.flatMap(
this.jsonFileReader.loadJsonByFileName(name),
beat => CompactBeatMapper.toBeatEffect(Option.getOrThrow(beat))
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
rg -n -C 3 'Option\.getOrThrow|Option\.isNone|Effect\.fail|loadJsonByFileName' frontend --glob '*.ts' || true

Repository: Babali42/DrumBeatRepo

Length of output: 12794


🏁 Script executed:

#!/usr/bin/env bash
set -e
printf '%s\n' '--- beat adapter ---'
cat -n frontend/src/app/infrastructure/adapters/beat-source/beat-adapter.service.ts
printf '%s\n' '--- reader interface and implementation ---'
cat -n frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.interface.ts
cat -n frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.service.ts
printf '%s\n' '--- reader tests ---'
cat -n frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.service.spec.ts
printf '%s\n' '--- adapter tests ---'
cat -n frontend/src/app/infrastructure/adapters/beat-source/beat-adapter.service.spec.ts
printf '%s\n' '--- package metadata ---'
fd -i 'package.json' -a -t f -x sh -c 'echo --- $1; rg -n "\"effect\"|\"typescript\"" "$1"' sh {}

Repository: Babali42/DrumBeatRepo

Length of output: 13846


🏁 Script executed:

#!/usr/bin/env bash
set -e
python3 - <<'PY'
from pathlib import Path
import re

adapter = Path("frontend/src/app/infrastructure/adapters/beat-source/beat-adapter.service.ts").read_text()
interface = Path("frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.interface.ts").read_text()
reader = Path("frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.service.ts").read_text()
tests = Path("frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.service.spec.ts").read_text()

checks = {
    "reader contract returns Option": bool(re.search(
        r"loadJsonByFileName\(fileName: string\):\s*Effect\.Effect<Option\.Option<CompactBeat>, never>",
        interface)),
    "adapter uses getOrThrow in single-beat path": "Option.getOrThrow(beat)" in adapter,
    "reader converts failed loads to Option.none": "Effect.option(" in reader,
    "reader test covers failed load": "Promise.reject(new Error('404'))" in tests,
    "reader implementation is currently unimplemented": "throw new Error('Method not implemented.')" in reader,
}

for name, result in checks.items():
    print(f"{name}: {'yes' if result else 'no'}")

assert checks["reader contract returns Option"]
assert checks["adapter uses getOrThrow in single-beat path"]
assert checks["reader converts failed loads to Option.none"]
assert checks["reader test covers failed load"]
PY

Repository: Babali42/DrumBeatRepo

Length of output: 383


🏁 Script executed:

#!/usr/bin/env bash
set -e
python3 - <<'PY'
from pathlib import Path
import re

adapter = Path("frontend/src/app/infrastructure/adapters/beat-source/beat-adapter.service.ts").read_text()
interface = Path("frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.interface.ts").read_text()
reader = Path("frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.service.ts").read_text()
tests = Path("frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.service.spec.ts").read_text()

checks = {
    "reader contract returns Option": bool(re.search(
        r"loadJsonByFileName\(fileName: string\):\s*Effect\.Effect<Option\.Option<CompactBeat>, never>",
        interface)),
    "adapter uses getOrThrow in single-beat path": "Option.getOrThrow(beat)" in adapter,
    "reader converts failed loads to Option.none": "Effect.option(" in reader,
    "reader test covers failed load": "Promise.reject(new Error('404'))" in tests,
    "reader implementation is currently unimplemented": "throw new Error('Method not implemented.')" in reader,
}

for name, result in checks.items():
    print(f"{name}: {'yes' if result else 'no'}")

assert checks["reader contract returns Option"]
assert checks["adapter uses getOrThrow in single-beat path"]
assert checks["reader converts failed loads to Option.none"]
assert checks["reader test covers failed load"]

Repository: Babali42/DrumBeatRepo

Length of output: 470


Return an Error effect for Option.none.

loadJsonByFileName returns Effect<Option<CompactBeat>, never>, and failed loads can produce Option.none. When beat is None, Option.getOrThrow(beat) throws outside the declared failure channel. Check Option.isNone(beat) and return Effect.fail(...); call CompactBeatMapper.toBeatEffect(beat.value) only for Some.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/app/infrastructure/adapters/beat-source/beat-adapter.service.ts`
around lines 16 - 20, Update getBeatByFileName to handle the Option returned by
loadJsonByFileName without throwing: check Option.isNone(beat), return
Effect.fail with an Error for None, and call
CompactBeatMapper.toBeatEffect(beat.value) only for Some values.

Comment on lines +13 to +15
loadJsonByFileName(filename: string): Effect.Effect<Option.Option<CompactBeat>, never> {
throw new Error('Method not implemented.');
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail
rg -n -C 3 '\b(loadJsonByFileName|getBeatByFileName)\s*\(' frontend --glob '*.ts'
rg -n -C 3 'loadAllBeats|/assets/beats/' frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.service.ts

Repository: Babali42/DrumBeatRepo

Length of output: 4153


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- reader service ---'
cat -n frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.service.ts

printf '%s\n' '--- adapter and interface ---'
cat -n frontend/src/app/infrastructure/adapters/beat-source/beat-adapter.service.ts
cat -n frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.interface.ts

printf '%s\n' '--- all filename call sites and beat asset references ---'
rg -n -C 4 '\bgetBeatByFileName\s*\(|\bloadJsonByFileName\s*\(|/assets/beats/|loadAllBeats\s*\(' frontend --glob '*.ts' --glob '*.html' --glob '*.json'

printf '%s\n' '--- beat asset filenames, if tracked ---'
git ls-files | rg '(^|/)assets/beats/|beats/.*\.json$' || true

Repository: Babali42/DrumBeatRepo

Length of output: 14839


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

printf '%s\n' '--- reader tests ---'
cat -n frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.service.spec.ts

printf '%s\n' '--- repository-wide lookup callers ---'
rg -n -C 5 '\bgetBeatByFileName\s*\(|\bloadJsonByFileName\s*\(' . --glob '!node_modules/**' --glob '!dist/**' --glob '!build/**'

printf '%s\n' '--- filename literals and route-like beat references ---'
rg -n -C 2 'techno\.json|/assets/beats/|filename\s*[:=]|fileName\s*[:=]' frontend --glob '!*.spec.ts'

printf '%s\n' '--- compact verifier for URL construction and asset matches ---'
python3 - <<'PY'
from pathlib import Path
import re

service = Path("frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.service.ts").read_text()
assets = {
    str(p.relative_to("frontend/src/assets/beats/"))[:-5]
    for p in Path("frontend/src/assets/beats").rglob("*.json")
}

files = re.findall(r"\.concat\((.*?)\)", service, re.S)
entries = []
for group in files:
    entries.extend(re.findall(r"'([^']+)'", group))
first = re.search(r"const files = \['([^']+)'\]", service)
if first:
    entries.insert(0, first.group(1))

print("loadAllJson entries:", len(entries))
print("asset matches without suffix:", sum(x in assets for x in entries), "/", len(entries))
print("asset matches with suffix:", sum((x + ".json") in assets for x in entries), "/", len(entries))
for supplied in ("techno", "techno.json"):
    url_key = supplied + ".json"
    print(f"{supplied!r} -> /assets/beats/{url_key}")
    print("  tracked asset:", url_key in {x + ".json" for x in assets})
PY

Repository: Babali42/DrumBeatRepo

Length of output: 20685


Implement loadJsonByFileName before merging.

The method throws before creating an Effect, so BeatAdapter.getBeatByFileName cannot load any beat. Delegate to loadAllBeats and normalize an optional .json suffix because loadAllBeats appends that suffix.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/src/app/infrastructure/adapters/beat-source/json-files-reader.service.ts`
around lines 13 - 15, Implement JsonFilesReaderService.loadJsonByFileName by
normalizing the filename to remove an optional .json suffix, delegating to
loadAllBeats (which appends the suffix), and returning the matching beat as an
Effect<Option<CompactBeat>, never> instead of throwing. Preserve Option.none
when no beat matches.

);

downloadBlob(blob, options.fileName);
downloadBlob(blob, options.filename);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Pass a filename in the export tests.

The handlers now read options.filename, but frontend/src/app/ui/components/sequencer/sequencer.component.spec.ts invokes both handlers with empty option objects at Line 215 and Line 226. Pass valid filename values and assert that downloadBlob receives them. Otherwise, the tests do not cover the rename and can exercise an undefined download name.

Also applies to: 250-250

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/src/app/ui/components/sequencer/sequencer.component.ts` at line 238,
Update the export tests for both handlers in the sequencer component spec to
provide valid filename values in their options, then assert that downloadBlob is
called with the corresponding blob and filename. Cover both handler paths so the
options.filename rename is verified and no test invokes them with an empty
options object.

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

@Babali42
Babali42 merged commit 09a0b30 into main Aug 11, 2026
3 of 4 checks passed
@Babali42
Babali42 deleted the rename-fileName-to-filename branch August 11, 2026 12:02
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.

1 participant