Skip to content

feat(jobs): add Sizes (HTML sizes attribute) to SrcsetJob #2

Description

@GustavoGutierrez

Context

A DevForge MCP audit (PRP 003, release v2.5.1) confirmed that the image_srcset handler reads a user-supplied input field that is silently dropped because the corresponding SrcsetJob protocol struct does not have a matching field.

What's missing in dpf

SrcsetJob accepts pixel widths (already wired) but has no field for the HTML sizes attribute — the responsive media-query value used by the browser to pick the right source from the srcset (e.g. (max-width: 600px) 100vw, 50vw).

Suggested field:

  • sizes: []string — HTML media-query rules, joined with , when rendered into the sizes='' attribute

What DevForge will do once this lands

In internal/tools/image_tools.go (ImageSrcset handler), the handler reads input.Sizes (the HTML attribute, distinct from the pixel-width slice). After this lands, that slice will be passed through to dpf and emitted alongside the generated srcset markup.

Impact

Today, callers asking dpf to produce a <img> snippet with custom sizes rules get a default empty sizes='' attribute. This is a real responsiveness regression for any consumer that wants explicit breakpoint hints.

References

  • DevForge commits: 3d1884b, 5235038
  • DevForge release: v2.5.1
  • DevForge memory: prp/003-tools-efficiency-and-reuse/preexisting-bugs

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions