Skip to content

Show a reel's track even when it was saved with only its id - #434

Merged
paulocastellano merged 5 commits into
mainfrom
instagram-audio-track-details
Oct 16, 2026
Merged

paulocastellano merged 5 commits into
mainfrom
instagram-audio-track-details

Conversation

@paulocastellano

@paulocastellano paulocastellano commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Composer: when a reel's track has an id but no title, cover or preview (an MCP or API post may send only meta.audio.id), the composer looks the track up when it opens and fills in what is missing: name, artist, cover and preview. Before this change it looked the track up only when a stored cover failed to load, so a track saved with only an id showed no name, no cover and a disabled preview, in the settings and in the reel preview.

  • Lookup: it runs only when the composer opens a reel (or the post type becomes Reel), never when a track is picked from the search, which already returned the same details. It only adds what is missing: a stored cover or preview is never replaced with an empty value, and a name or artist already stored is kept.

  • Cost: one audio lookup the first time a post with missing details is opened, then cached for an hour per account and track. A track whose cover Instagram never provides (some original sounds) is looked up again when that cache expires.

  • Unsaved-changes guard (useComposerUnsavedChanges.ts): a track is compared by its id and volumes only. Its name, cover and preview come with the id and are filled in by the composer on its own, so a lookup that lands after the first click no longer asks "Discard changes?" when you close an untouched post. Before, this could already happen with the renewal of an expired cover.

  • MCP descriptions:

    • search-instagram-audio-tool and get-instagram-audio-tool name the platform (instagram-facebook), and the search asks to copy title, artist, cover_url and preview_url into meta.audio.
    • The meta documentation names the platform for audio, and explains that a collaborator sees the post on their profile only after accepting the invite in the Instagram app, and that a username that does not exist is refused only when the post publishes.
  • Browser test waits: shared helpers in tests/Pest.php (waitFor, waitForGone, waitForState, waitForText, waitForGoneOrShown, waitForPath, waitForCondition) take a CSS selector where @name stands for a test id, as in $page->click('@name'). They replace the polling loop each file copied. ComposerUnsavedChangesTest and ComposerChannelSettingsTest use them with no querySelector inside a wait. AGENTS.md now requires them for every wait; moving the other 96 files is Move every browser test to the shared wait helpers #435.

Tests

  • tests/Browser/ComposerUnsavedChangesTest.php, both new tests checked to fail without their change:
    • a reel whose track was saved with only its id shows the track name and cover: fails without the lookup on open.
    • track details that arrive after the first click do not count as an unsaved change: delays the lookup by 1.5 s, clicks first, then closes. Fails without the guard change.
    • a music cover renewed after the post opened…: its track now carries a preview_url, so it still tests a broken cover being renewed (with the preview missing, the track would now be looked up when it opens).
  • tests/Browser/ComposerChannelSettingsTest.php › the instagram reel card picks music…: also asserts that picking a track makes no detail lookup (it counts the composer's requests in the browser). Fails if the lookup watches the track id.
  • tests/Feature/Mcp/ToolDocumentationTest.php: the new description text.
  • Passing: ComposerUnsavedChangesTest (53), ComposerChannelSettingsTest (64), MCP documentation, PostPlatformMetaRulesTest, FullPostParityTest, ChannelsParityTest.

Manual test checklist

  • With MCP, create a reel on an instagram-facebook account with meta.audio holding only id, then open it in the composer: the music row shows the name, artist and cover, preview plays, and the reel preview shows "Title · Artist".
  • Close it without touching anything: nothing is asked.
  • Open it, click into the text right away, then close: nothing is asked.
  • Change the music volume, then close: "Discard changes?" is asked.
  • Pick another track, then close: it asks.

Paulo Castellano added 2 commits October 16, 2026 13:52
The composer now fills in a picked track's name, cover and preview when they are missing (an MCP or API post may send only meta.audio.id), and the unsaved-changes guard compares a track by its id and volumes only, so details that arrive after the first click never ask before closing. The MCP descriptions name the instagram-facebook platform, ask to copy the track details into meta.audio, and explain that collaborators must accept the invite.
Picking a track no longer spends an audio lookup, the lookup no longer requires the answer to repeat the id, and the guard helper is named for what it returns.
Paulo Castellano added 3 commits October 16, 2026 14:35
The waits in ComposerUnsavedChangesTest and ComposerChannelSettingsTest go through helpers in tests/Pest.php instead of a polling loop copied per file and inline querySelector conditions. AGENTS.md now requires the shared helpers for every wait; moving the other browser tests is tracked in #435.
One set of helpers covers test ids, roles and nested selectors: @name stands for a test id anywhere in the selector, as in $page->click('@name'). waitForText replaces the textContent waits, and the per-file closed-menu helper is gone.
@paulocastellano
paulocastellano merged commit b06344b into main Oct 16, 2026
10 checks passed
@paulocastellano
paulocastellano deleted the instagram-audio-track-details branch October 16, 2026 18:13
paulocastellano pushed a commit to trypostit/trypost-docs that referenced this pull request Oct 16, 2026
Follows trypostit/trypost#434: the app fills a track's name, cover and preview when they are missing, and the MCP descriptions now ask to copy them and explain that collaborators must accept the invite.
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