DevWeave logoDevWeave
CommunitiesDiscoverHelp ForumFeaturesWhy DevWeaveAI & Verification
Log inGet started
Back to Issue Discovery
NWACus/web #307openTypeScriptJavaScript & TypeScript

Folder structure for Media

Opened by @rchlfryn · Assignees: None

View on GitHub
enhancementgood first issueready-for-agent

Solve & Merge Reward: Up to +210 XP & +60 Coins

+30 XP on PR open · +180 XP & +60 coins on merge

7 GitHub Stars

Claim Status & GitHub Signal

Unassigned, with 4 comments. Unassigned does not guarantee unclaimed—read comments and linked PRs first.

AI Issue Assessment · Grounded Analyzer
2.8 / 10 · 3–4 · Beginner

Estimated from issue labels (enhancement, good first issue, ready-for-agent), TypeScript context, and discussion depth. There are 4 GitHub comments to review for maintainer clarifications. Note: this is an estimate, not a guarantee.

What It's About

Folder structure for Media. In our initial overview with SAC, it was mentioned there might be a need for adding folder structure to Media. (ie: Bios/ , BlogImages/)

Why It Matters

Resolving #307 improves reliability and developer experience in NWACus/web.

Expected Outcome

A focused pull request addressing #307 with relevant checks or tests verified locally.

Skill Match Breakdown

Log in to compare this issue's requirements against your profile skills. Required concepts: TypeScript, SQL & Databases.

Progressive AI Hints

Hint #1 is always free and calibrated to your experience level. Extra hints unlock with coins without spoiling the full solution.

Log in to receive your free level-adapted Hint #1 grounded in this repository's files.

Skill-Gap Learning

Gap-Targeted
Learn SQL

Relational modeling, joins, constraints, and query optimization.

Addresses skill gap: SQL & Databases

Learn TypeScript

Strong typing, interfaces, generics, and safer JavaScript/TypeScript code.

Addresses skill gap: TypeScript

Hands-On CodeCrafters Practice
Skill-Gap Challenge
Build your own Kafka
TypeScript

Implement binary wire protocols, correlation IDs, and concurrent broker requests.

Practice skill gap: TypeScript

Build your own Shell
TypeScript

Parse commands, manage PATH lookups, pipes, and process execution.

Practice skill gap: TypeScript

Issue Description

In our initial overview with SAC, it was mentioned there might be a need for adding folder structure to Media. (ie: Bios/ , BlogImages/)

Linked Pull Requests (0)

No linked or cross-referenced pull requests detected via GitHub timeline. Check comments below for informal claims before starting.

GitHub Comments (4)

@busbykCOLLABORATOR
View comment →

@rustynwac -- this functionality actually just got into Payload core. We'll need to upgrade to the latest version and it's still pretty new / seems to have some minor bugs that are getting fixed.

So we can turn this on pretty easily but I don't think it's necessary for launch but let me know if you think otherwise.

https://payloadcms.com/docs/folders/overview

@andyanderso
View comment →

If it is really easy, I would love to turn this on to build the media organization structure as we load content. It seems like that will be easier than organizing all the media afterwards.

@busbykCOLLABORATOR
View comment →

If it is really easy, I would love to turn this on to build the media organization structure as we load content. It seems like that will be easier than organizing all the media afterwards.

Seems reasonable to add this to me. I'd like to wait until https://github.com/NWACus/web/pull/571 is merged and then we can play around with this more and see what the implications are to the UI.

@busbykCOLLABORATOR
View comment →

This was generated by AI during triage.

Agent Brief

Category: enhancement Summary: Enable Payload's native folder organization on the Media collection, scoped per-tenant.

Current behavior: The Media collection (slug media) presents a flat, tenant-filtered list with no way to group assets into folders. Payload (currently 3.81.0) ships native folder support, but it is entirely off here — there is no top-level folders config and no folders option on any collection.

Desired behavior: Editors can organize media into folders in the admin, and folders are strictly tenant-scoped — a user in one avalanche center only sees and assigns folders belonging to their own tenant. This scoping is the crux of the issue: Payload auto-creates a single global folders collection (default slug payload-folders) that has no tenant field and is not covered by the existing tenant list filter, so simply flipping the feature on would let every tenant see and reassign every other tenant's folders — a data-isolation bug that must not ship.

Key interfaces:

  • Enable folders: true on the Media CollectionConfig.
  • Add the top-level folders config to the Payload config. Note this root config is marked experimental upstream ("may change in minor versions") — call it out in the PR. Use its collectionOverrides hook to inject the tenant relationship field, the tenant list filter, and tenant-aware RBAC access into the generated folders collection, mirroring how every other tenant-scoped collection is assembled (the repo's tenantField() + filterByTenant base-list-filter pattern; the home-grown tenancy layer, not @payloadcms/plugin-multi-tenant).
  • Add the generated folders collection's slug to the tenant deprovision hook's list of tenant-scoped collections so folders cascade-delete with their tenant (avoids SQLite FK errors on tenant deletion).
  • Schema change → generate a migration (SQLite adapter) and run pnpm generate:types.

Acceptance criteria:

  • Media documents can be placed into and moved between folders in the admin UI.
  • A user in tenant A cannot see, select, or assign a folder created under tenant B.
  • Deleting a tenant removes its folders with no foreign-key errors.
  • A migration is generated and pnpm migrate:check passes.
  • pnpm generate:types has been run and folder types are present; pnpm seed:standalone completes.

Out of scope:

  • Enabling folders on any collection other than Media (Documents is the obvious follow-up but is a separate issue).
  • Migrating/auto-sorting existing media into folders.
  • Any change to the public-facing frontend — this is admin-only organization.
Peer Help Forum · NWACus/web #307

Issue Troubleshooting Threads (0)

Ask Peers for Help

No troubleshooting threads opened for this issue yet. If you hit a test, build, or navigation blocker, post what you've tried so fellow contributors can help.

PR Verification & Rewards

Sign in and link GitHub to verify your PR against this issue and earn XP + coins.

Sign In

Contribution Workflow

Track your local progress before opening a pull request on GitHub.

Repository Context

Top Repository Paths

[dir] .agents
[dir] .agents/skills
[dir] .agents/skills/codebase-design
.agents/skills/codebase-design/DEEPENING.md
.agents/skills/codebase-design/DESIGN-IT-TWICE.md
.agents/skills/codebase-design/SKILL.md
[dir] .agents/skills/codebase-design/agents
.agents/skills/codebase-design/agents/openai.yaml
[dir] .agents/skills/diagnosing-bugs
.agents/skills/diagnosing-bugs/SKILL.md
[dir] .agents/skills/diagnosing-bugs/agents
.agents/skills/diagnosing-bugs/agents/openai.yaml
[dir] .agents/skills/diagnosing-bugs/scripts
.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh
[dir] .agents/skills/domain-modeling
.agents/skills/domain-modeling/ADR-FORMAT.md
.agents/skills/domain-modeling/GLOSSARY-FORMAT.md
.agents/skills/domain-modeling/SKILL.md
[dir] .agents/skills/domain-modeling/agents
.agents/skills/domain-modeling/agents/openai.yaml
[dir] .agents/skills/draft-release-notes
.agents/skills/draft-release-notes/SKILL.md
[dir] .agents/skills/grill-me
.agents/skills/grill-me/SKILL.md

Advisory PR Assistant

Helps structure your PR description or unpack reviewer feedback. Does not perform GitHub actions.