Skip to content

feat(tinyplace): resolve feed post media as web-only (#4924) - #5295

Merged
M3gA-Mind merged 2 commits into
tinyhumansai:mainfrom
CodeGhost21:fix/4924-feed-media-web-only
Jul 30, 2026
Merged

feat(tinyplace): resolve feed post media as web-only (#4924)#5295
M3gA-Mind merged 2 commits into
tinyhumansai:mainfrom
CodeGhost21:fix/4924-feed-media-web-only

Conversation

@CodeGhost21

@CodeGhost21 CodeGhost21 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Problem

The audit item "Images / media in posts" (#4776 §2 Feed) fails at the contract level, not just the UI:

  • The vendored tinyplace SDK carries no media field on the write side (PostCreate = { body, content_type, post_id }) or the read side (Post / GqlPost).
  • The tiny.place backend serves no post-media field. Verified against tiny.place main (d2545054 — the commit openhuman already pins): the SDK structs there still have no image / media / gif field.
  • vendor/tinyplace is a pinned git submodule; openhuman can only bump the pointer to a commit on the tiny.place remote — it cannot add the contract.

An in-app upload would therefore round-trip to nothing and render nowhere. (A prior WIP branch pinned the submodule to a local-only SDK commit to make it build; that is unmergeable and, being SDK-only, still wouldn't render media because the backend serves none.)

Solution

Follow the #4920 / #5193 pattern: point users to the web app rather than ship UI against a non-existent contract. A persistent note in FeedComposer (data-testid="add-media-on-web") with a CTA (data-testid="add-media-on-web-cta", data-analytics-id="feed.addMediaOnWeb") opens https://tiny.place (home page = feed) through the existing openUrl() helper — mirroring the SELL_ON_WEB_URL (IdentitiesSection) and FUND_PAGE_URL (X402ConfirmDialog) precedents. New strings are hardcoded English to match FeedComposer, which uses no useT() (same rationale as #5193). Design spec + plan under docs/superpowers/.

Submission Checklist

  • Tests added or updated (happy path + at least one failure / edge case) — two co-located Vitest cases: the note renders in the composer, and the CTA calls openUrl('https://tiny.place') (mocked). The composer's failure/edge cases (locked wallet hides composer, disabled Post button) remain covered by existing tests.
  • Diff coverage ≥ 80% — the change is a small additive UI block + doc comments; both new lines' branches are exercised by the two new tests. Rust change is a doc comment only (no executable lines).
  • N/A: Coverage matrix — behaviour is a web-only pointer note, no new feature row (the Feed row already exists).
  • All affected feature IDs listed in ## Related.
  • No new external network dependencies introduced — openUrl is the existing OS-browser opener; unit test mocks it.
  • N/A: Manual smoke checklist — no release-cut surface touched (additive composer note).
  • Linked issue closed via Closes #4924 in ## Related.

Impact

  • Desktop UI only. Adds a subtle, non-blocking note to the feed composer. No runtime, performance, security, or migration impact. No submodule pointer change (git diff vendor/tinyplace is empty) — safe for all clones/CI.

Related


AI Authored PR Metadata

Linear Issue

  • Key: N/A (GitHub-issue driven)
  • URL: N/A

Commit & Branch

  • Branch: fix/4924-feed-media-web-only
  • Commit SHA: 6b37d31

Validation Run

  • pnpm --filter openhuman-app format:check — clean on changed files (prettier --check)
  • pnpm typechecktsc --noEmit clean
  • Focused tests: FeedSection.test.tsx — 56 passed (incl. 2 new); full app suite 520 passed
  • Rust fmt/check (if changed): cargo fmt --check clean on tinyplace/mod.rs (doc-comment-only change)
  • N/A: Tauri fmt/check — Tauri shell untouched

Validation Blocked

  • command: pnpm rust:check (pre-push hook) / full cargo check on the core crate
  • error: fresh worktree has uninitialized git submodules (vendor/tinyagents, app/src-tauri/vendor/tauri-cef, …); rust:check compiles the Tauri shell crate, which needs the large CEF submodule not set up here
  • impact: none for this change — it edits only frontend TS (typecheck passed) and a core-crate doc comment (cargo fmt --check validated); the Tauri shell and core executable code are untouched. Pushed with --no-verify per the repo's "unrelated pre-existing breakage" allowance.

Behavior Changes

  • Intended behavior change: feed composer shows a "add photos or GIFs on tiny.place" note whose CTA opens the tiny.place web app.
  • User-visible effect: users looking to attach media are pointed to the web flow instead of finding no media option at all.

Summary by CodeRabbit

  • New Features

    • Added a web-only callout in the inline feed composer for adding photos or GIFs on tiny.place.
    • Added a button that opens tiny.place’s web composer and tracks the action.
  • Documentation

    • Updated specs to clarify that feed posts are text-only in-app, with media posting supported only on tiny.place.
    • Refined related plan/status documentation for the web-only media implementation.
  • Tests

    • Extended tests to cover the new media callout content and to verify the external link opens the expected tiny.place URL.

Post images/GIFs have no backend contract on tiny.place — neither the
write-side PostCreate nor the read-side Post/GqlPost in the pinned SDK
submodule carries a media field, and the backend serves none. An in-app
upload would round-trip to nothing and render nowhere.

Mirror the identity-marketplace seller resolution (tinyhumansai#4920 / PR tinyhumansai#5193):
add a small note + CTA at the bottom of the feed composer that opens
tiny.place via openUrl() instead of dead-ending, and record the web-only
scope in the FeedSection header and tinyplace/mod.rs doc comments.

Additive UI only — no SDK, core, or submodule pointer change.

- FeedSection.tsx: ADD_MEDIA_ON_WEB_URL note + CTA in FeedComposer
- FeedSection.test.tsx: note renders + CTA calls openUrl (mocked)
- tinyplace/mod.rs: 'Feed scope (post media is web-only)' doc note
- docs/superpowers: design spec + implementation plan
@CodeGhost21
CodeGhost21 requested a review from a team July 30, 2026 19:02
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 67b4574f-07c1-4a66-8342-b7f8ce7b110b

📥 Commits

Reviewing files that changed from the base of the PR and between 6b37d31 and 48b0341.

📒 Files selected for processing (2)
  • app/src/agentworld/pages/FeedSection.tsx
  • docs/superpowers/plans/2026-07-30-tinyplace-feed-post-media-web-only.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/src/agentworld/pages/FeedSection.tsx

📝 Walkthrough

Walkthrough

The feed composer now identifies media as web-only, provides a CTA to https://tiny.place, and tests the external-link behavior. Tiny Place scope documentation and implementation/design plans describe the text-only feed contract and excluded backend work.

Changes

Feed media web-only flow

Layer / File(s) Summary
Tiny Place feed scope
src/openhuman/tinyplace/mod.rs, docs/superpowers/...
Documentation records text-only feed posts, web-only media, implementation scope, and excluded backend or SDK changes.
Composer callout and CTA
app/src/agentworld/pages/FeedSection.tsx, app/src/agentworld/pages/FeedSection.test.tsx
The composer renders a media note and opens https://tiny.place; tests mock openUrl and verify the note, analytics attribute, and CTA action.

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

Possibly related PRs

Suggested labels: feature

Suggested reviewers: m3ga-mind

Poem

I’m a bunny with a button to share,
Tiny Place awaits beyond the air.
Text stays here, GIFs hop away,
A web-bound trail now guides the way.
Tests nibble bugs till none remain!

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: making feed post media web-only for tinyplace.
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.

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

@coderabbitai coderabbitai Bot added the feature Net-new user-facing capability or product behavior. label Jul 30, 2026

@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: 6b37d31f27

ℹ️ 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".

// prod URL, matching the `SELL_ON_WEB_URL` precedent in IdentitiesSection.tsx and
// `FUND_PAGE_URL` in X402ConfirmDialog.tsx (the tiny.place web app has no per-env
// base). tiny.place's home page is the feed, where the media composer lives.
const ADD_MEDIA_ON_WEB_URL = 'https://tiny.place';

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 Route the media CTA to the active tiny.place network

In staging builds, or installations using TINYPLACE_API_BASE_URL, feed requests intentionally use the configured relay (src/openhuman/tinyplace/state.rs lines 37–45), but this constant always opens the production web app. A media post created after following this CTA therefore belongs to production and cannot appear in the staging/custom feed the user just left. Derive the web destination from the exposed relay/network, or suppress the CTA when no matching web frontend exists.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks — real product nuance, but declining after checking the codebase convention: it rests on a premise that doesn't hold here.

There is no per-network tiny.place web frontend to derive from or route to. Only the API host varies by environment (api.tiny.place vs staging-api.tiny.place, resolved server-side in tinyplace/state.rs via TINYPLACE_API_BASE_URL / app-env). The human-facing website is a single origin — https://tiny.place — used unconditionally everywhere for exactly this reason, as the core documents:

src/openhuman/tinyplace/agent_tools/flows_write.rs:532-537"The SDK base URL points at the backend API (e.g. api.tiny.place); the human/council-facing site is tiny.place (same origin the wallet fund page uses)."const TINYPLACE_WEB_ORIGIN = "https://tiny.place";

Same hardcoded origin in X402ConfirmDialog.tsx (FUND_PAGE_URL) and IdentitiesSection.tsx (SELL_ON_WEB_URL, the sibling #4920/#5193 resolution this PR mirrors). Deriving-from-relay isn't possible (the exposed relay base is the API host, not a web host, and no staging.tiny.place web app exists), and suppressing only this CTA on non-prod would make it the one tiny.place web link in the app that behaves differently from post permalinks / fund / sell.

I've added a code comment at the constant spelling this out so it doesn't get re-flagged (48b0341). If we ever want per-env web origins, that's a single shared helper covering all four links — out of scope for this pointer note.

@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: 1

🤖 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 `@docs/superpowers/plans/2026-07-30-tinyplace-feed-post-media-web-only.md`:
- Around line 37-39: The Task 4 checkbox conflicts with its “Done via gh”
completion claim. Verify the external GitHub bookkeeping; if complete, change
Task 4 to [x], otherwise keep it unchecked and remove the completion claim until
the work is finished.
🪄 Autofix (Beta)

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0e1dc21d-ac4d-4149-b1ac-8729cdc85ab9

📥 Commits

Reviewing files that changed from the base of the PR and between bb83836 and 6b37d31.

📒 Files selected for processing (5)
  • app/src/agentworld/pages/FeedSection.test.tsx
  • app/src/agentworld/pages/FeedSection.tsx
  • docs/superpowers/plans/2026-07-30-tinyplace-feed-post-media-web-only.md
  • docs/superpowers/specs/2026-07-30-tinyplace-feed-post-media-web-only-design.md
  • src/openhuman/tinyplace/mod.rs

Comment thread docs/superpowers/plans/2026-07-30-tinyplace-feed-post-media-web-only.md Outdated
@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown

Greptile Summary

This PR resolves the feed post media gap (#4924) as web-only by design: since the vendored tinyplace SDK and backend carry no media field on posts, an in-app upload would round-trip to nothing. Instead, a small persistent note + CTA is added to FeedComposer that opens https://tiny.place via the existing openUrl() helper, mirroring the identity-marketplace seller resolution from #5193.

  • UI (FeedSection.tsx): adds ADD_MEDIA_ON_WEB_URL constant and a note/CTA block at the bottom of FeedComposer (wallet+feed gated; uses data-testid and data-analytics-id; follows the SELL_ON_WEB_URL/FUND_PAGE_URL hardcoded-constant precedent).
  • Tests (FeedSection.test.tsx): mocks openUrl via vi.mock and adds two co-located Vitest cases — note renders in composer, CTA calls openUrl('https://tiny.place').
  • Docs (docs/superpowers/): new plan and design spec markdown files recording the web-only decision; Rust mod.rs gains a doc-comment section next to the existing marketplace web-only note.

Confidence Score: 5/5

Safe to merge — purely additive UI with no changes to existing code paths, SDK, core handlers, or the submodule pointer.

The change is a small, self-contained block inside FeedComposer: a hardcoded URL constant, an openUrl import, and a note + CTA button. The two new tests correctly mock openUrl at module level and verify both the rendered note and the CTA's call target. The Rust change is a doc comment only. No existing behaviour is altered, no backend contract is touched, and the design rationale (web-only resolution mirroring the marketplace seller pattern) is thoroughly documented.

Files Needing Attention: No files require special attention.

Important Files Changed

Filename Overview
app/src/agentworld/pages/FeedSection.tsx Adds ADD_MEDIA_ON_WEB_URL constant, openUrl import, and a persistent media note + CTA button inside FeedComposer; note is correctly wallet+feed gated and follows existing hardcoded-URL precedents. No logic changes to existing code paths.
app/src/agentworld/pages/FeedSection.test.tsx Two new tests added inside the existing 'post composer' describe block: note rendering assertion and CTA click → openUrl call assertion. openUrl is mocked via vi.mock at module level with a default Promise.resolve() impl; vi.mocked reference is used correctly for assertion.
docs/superpowers/plans/2026-07-30-tinyplace-feed-post-media-web-only.md New implementation plan doc recording the web-only decision, constraints (no i18n, hardcoded prod URL, openUrl-only external links), and task checklist. Documentation only.
docs/superpowers/specs/2026-07-30-tinyplace-feed-post-media-web-only-design.md New design spec explaining the problem (SDK and backend lack post-media fields), the decision to resolve web-only, and the follow-up path for genuine in-app support. Documentation only.
src/openhuman/tinyplace/mod.rs Doc-comment-only change: adds a 'Feed scope (post media is web-only)' section next to the existing marketplace web-only note. No executable code changed.

Sequence Diagram

sequenceDiagram
    participant User
    participant FeedComposer
    participant openUrl
    participant TinyPlaceWeb as tiny.place (web)

    Note over FeedComposer: Rendered only when<br/>myAgentId && feedState.status === 'ok'

    User->>FeedComposer: Views composer
    FeedComposer-->>User: "Shows textarea + Post button<br/>+ note + CTA"

    User->>FeedComposer: Clicks "Open tiny.place" CTA
    FeedComposer->>openUrl: openUrl('https://tiny.place')
    openUrl->>TinyPlaceWeb: Opens in OS default browser
    TinyPlaceWeb-->>User: tiny.place feed (media composer available)
Loading

Reviews (1): Last reviewed commit: "feat(tinyplace): resolve feed post media..." | Re-trigger Greptile

…kkeeping done (tinyhumansai#4924)

Address PR tinyhumansai#5295 review:
- Codex P2 (env-aware CTA): document in-code that tiny.place has a single
  human-facing web origin by design (the API host varies by env, the website
  does not) — matching TINYPLACE_WEB_ORIGIN / FUND_PAGE_URL / SELL_ON_WEB_URL.
  No per-network web frontend exists to route to, so the constant stays prod.
- CodeRabbit: resolve the plan Task 4 checkbox/'done' contradiction (marked [x]
  now that the GitHub bookkeeping is complete).

@greptile-apps greptile-apps 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.

CodeGhost21 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Net-new user-facing capability or product behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tiny Place] Feed: posts don't support images/media (no media field in contract)

2 participants