Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduces date selector to xilem #567

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

giannissc
Copy link
Contributor

@giannissc giannissc commented Aug 29, 2024

I pushed a first draft so that people can have a look but I am not happy with it. I think I misunderstand how map_state and adapt work. I was under the impression that you can take any arbitrary state, create a subset and then pass it to a child view. In this case, I was hoping to be able to do

struct DateLocal {
    month: Month,
    year: i32,
}

}
struct Calendar {
    selected_date: Date,
    date_local_1: DateLocal,
    date_local_2: DateLocal,
}

Using this I though I could share selected_date between two date() view and adapt the state using (selected_date, date_local_1) and (selected_date, date_local_2)

Is there something I am missing here?

@giannissc
Copy link
Contributor Author

I believe this is ready for review! I still haven't evaluated the state_accessoralternative we talked about in Zulip but since I don't hate this I am happy to merge and create a new PR for any future changes! @Philipp-M

Copy link
Member

@DJMcNab DJMcNab left a comment

Choose a reason for hiding this comment

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

Don't have time for a full review, but some initial thoughts.

Could you also include a screenshot in this thread?

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this should live in a components folder? From a developer of Xilem perspective, there is a meaningful difference between "raw" views and composed components. But from an end-user perspective, they are the same.

I don't know what the right answer is here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am going to actually create an RFC to discuss this among ither things that i have in mind. For now I would suggest to do both. In the internal folder organisation there should be a primitives folder and a components folder but at the tip the should all be re-exported together. Does this sound reasonable?

Nop,
}

pub struct DatePicker {
Copy link
Member

Choose a reason for hiding this comment

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

We should have some docs here.

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.

2 participants