Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

DEV: Migrate nav menu preferences to use formkit#36704

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
jordanvidrine wants to merge8 commits intomain
base:main
Choose a base branch
Loading
fromnavmenu-pref-formkit

Conversation

@jordanvidrine
Copy link
Contributor

Fairly straightforward refactor.

BeforeAfter
CleanShot 2025-12-15 at 15 20 04@2xCleanShot 2025-12-15 at 15 19 40@2x

@jordanvidrinejordanvidrine marked this pull request as ready for reviewDecember 15, 2025 21:20
Copy link
Contributor

@martin-brennanmartin-brennan left a comment

Choose a reason for hiding this comment

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

Just a minor change so far, but we do need a system spec here. Also you have some failing tests

</template>
this.args.model
.save(this.saveAttrNames)
.catch(popupAjaxError)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you will need to handle rolling back the model values on error here

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I think .save() is what actually changes these items. I looked at the way other controllers for these preferences were doing it.

@action
save(){
this.set("saved",false);
returnthis.model
.save(this.saveAttrNames)
.then(()=>this.set("saved",true))
.catch(popupAjaxError);
}

@action
save(){
this.set("saved",false);
constmakeThemeDefault=this.makeThemeDefault;
if(makeThemeDefault){
this.set("model.user_option.theme_ids",[this.themeId]);
}
constmakeTextSizeDefault=this.makeTextSizeDefault;
if(makeTextSizeDefault){
this.set("model.user_option.text_size",this.textSize);
}
if(!this.showColorSchemeSelector){
this.set("model.user_option.color_scheme_id",null);
this.set("model.user_option.dark_scheme_id",null);
}elseif(this.makeColorSchemeDefault){
this.set("model.user_option.color_scheme_id",this.selectedColorSchemeId);
this.set(
"model.user_option.dark_scheme_id",
this.selectedDarkColorSchemeId
);
if(this.selectedInterfaceColorModeId){
this.set(
"model.user_option.interface_color_mode",
this.selectedInterfaceColorModeId
);
}
}
returnthis.model
.save(this.saveAttrNames)
.then(()=>{
this.set("saved",true);
if(makeThemeDefault){
setLocalTheme([]);
}else{
setLocalTheme(
[this.themeId],
this.get("model.user_option.theme_key_seq")
);
}
if(makeTextSizeDefault){
this.model.updateTextSizeCookie(null);
}else{
this.model.updateTextSizeCookie(this.textSize);
}
if(this.makeColorSchemeDefault){
updateColorSchemeCookie(null);
updateColorSchemeCookie(null,{dark:true});
}else{
updateColorSchemeCookie(this.selectedColorSchemeId);
if(
this.defaultDarkSchemeId>0&&
this.selectedDarkColorSchemeId===this.defaultDarkSchemeId
){
updateColorSchemeCookie(null,{dark:true});
}else{
updateColorSchemeCookie(this.selectedDarkColorSchemeId,{
dark:true,
});
}
}
if(this.selectedInterfaceColorModeId){
if(this.isViewingOwnProfile){
constmodeId=this.selectedInterfaceColorModeId;
if(modeId===INTERFACE_COLOR_MODES.AUTO){
this.interfaceColor.useAutoMode();
}elseif(modeId===INTERFACE_COLOR_MODES.LIGHT){
this.interfaceColor.forceLightMode();
}elseif(modeId===INTERFACE_COLOR_MODES.DARK){
this.interfaceColor.forceDarkMode();
}
}
this.selectedInterfaceColorModeId=null;
}
this.homeChanged();
if(this.themeId&&this.themeId!==this.currentThemeId){
reload();
}
})
.catch(popupAjaxError);
}

@jordanvidrine
Copy link
ContributorAuthor

we do need a system spec here

I have added one, and removed a dated one that no longer seemed to be in use.

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

Reviewers

@martin-brennanmartin-brennanmartin-brennan left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@jordanvidrine@martin-brennan@jjaffeux

[8]ページ先頭

©2009-2025 Movatter.jp