Skip to content

feat!: more form attributes#352

Merged
m4tx merged 23 commits into
cot-rs:masterfrom
ElijahAhianyo:elijah/more-form-attrs
Jul 11, 2026
Merged

feat!: more form attributes#352
m4tx merged 23 commits into
cot-rs:masterfrom
ElijahAhianyo:elijah/more-form-attrs

Conversation

@ElijahAhianyo

@ElijahAhianyo ElijahAhianyo commented Jun 18, 2025

Copy link
Copy Markdown
Contributor

This PR adds more form attributes to various HTML elements in cot

@github-actions github-actions Bot added the C-lib Crate: cot (main library crate) label Jun 18, 2025
@codecov

codecov Bot commented Jun 18, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.75516% with 33 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cot/src/form/fields.rs 93.56% 8 Missing and 21 partials ⚠️
cot/src/openapi.rs 0.00% 2 Missing ⚠️
cot-cli/src/migration_generator.rs 85.71% 1 Missing ⚠️
cot/src/form/fields/files.rs 96.87% 0 Missing and 1 partial ⚠️
Flag Coverage Δ
rust 90.25% <96.75%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cot-core/src/html.rs 98.57% <100.00%> (+0.11%) ⬆️
cot-macros/src/form.rs 96.77% <ø> (ø)
cot/src/auth.rs 91.05% <100.00%> (ø)
cot/src/form.rs 93.85% <100.00%> (+0.26%) ⬆️
cot/src/form/fields/attrs.rs 100.00% <100.00%> (+100.00%) ⬆️
cot/src/form/fields/chrono.rs 93.33% <100.00%> (-0.37%) ⬇️
cot/src/form/fields/select.rs 98.08% <100.00%> (-0.02%) ⬇️
cot/src/session/store/file.rs 92.21% <ø> (ø)
cot-cli/src/migration_generator.rs 89.57% <85.71%> (-0.05%) ⬇️
cot/src/form/fields/files.rs 92.46% <96.87%> (-0.40%) ⬇️
... and 2 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ElijahAhianyo ElijahAhianyo force-pushed the elijah/more-form-attrs branch from 4824f19 to e6b2f3d Compare July 12, 2025 18:20
@ElijahAhianyo ElijahAhianyo marked this pull request as ready for review February 8, 2026 20:05
@ElijahAhianyo ElijahAhianyo force-pushed the elijah/more-form-attrs branch from c55425b to c7ba160 Compare February 8, 2026 21:34
@ElijahAhianyo ElijahAhianyo changed the title wip: Add more form attributes Add more form attributes Feb 8, 2026
@ElijahAhianyo ElijahAhianyo requested review from m4tx and seqre February 9, 2026 11:44
Comment thread cot-core/src/html.rs Outdated
Comment thread cot-core/src/html.rs Outdated
Comment thread cot-core/src/html.rs
/// let rendered = data_list.render();
/// ```
#[must_use]
pub fn data_list<I, S>(list: I, id: &str) -> Self

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure if we should force providing id in the constructor, maybe getting rid of it and expecting users to do .attr("id", id") is enough?

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.

mm, The thing about the datalist element is that the id attr is tightly coupled with the list attribute in the input element (i.e the list attr in the input should match the id attr in the datalist) so if the user forgets to call .attr("id", id) it wont work. I had that as a parameter because it's required for correctness

Comment thread cot/src/form/fields.rs
Comment thread cot/src/form/fields.rs
Comment thread cot/src/form/fields.rs
Comment thread cot/src/form/fields.rs Outdated
Comment thread cot/src/form/fields.rs
Comment thread cot/src/form/fields.rs
Comment thread cot/src/form/fields/attrs.rs
@m4tx m4tx changed the title Add more form attributes feat: more form attributes May 21, 2026
@m4tx m4tx changed the title feat: more form attributes feat!: more form attributes May 21, 2026

@m4tx m4tx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, but please fix the minor issues I've mentioned before merging.

Comment thread cot/src/form/fields/files.rs
Comment thread cot-core/src/html.rs Outdated
Comment thread cot/src/form/fields/attrs.rs
Comment thread cot/src/form/fields/attrs.rs
@ElijahAhianyo ElijahAhianyo requested a review from m4tx June 30, 2026 00:15
@github-actions github-actions Bot added the C-macros Crate: cot-macros label Jul 10, 2026
@github-actions github-actions Bot added the C-cli Crate: cot-cli (issues and Pull Requests related to Cot CLI) label Jul 10, 2026

@m4tx m4tx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, great work!

@m4tx m4tx merged commit 1fad55f into cot-rs:master Jul 11, 2026
25 of 26 checks passed
@cotbot cotbot Bot mentioned this pull request Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-cli Crate: cot-cli (issues and Pull Requests related to Cot CLI) C-core C-lib Crate: cot (main library crate) C-macros Crate: cot-macros

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants