chore(react/type_widget): fix sizing

This commit is contained in:
Elian Doran
2025-09-20 11:29:28 +03:00
parent 6bcce08042
commit e576fa03da
5 changed files with 11 additions and 11 deletions

View File

@@ -1,6 +1,5 @@
import FlexContainer from "../widgets/containers/flex_container.js";
import NoteTitleWidget from "../widgets/note_title.js";
import NoteDetailWidget from "../widgets/note_detail.js";
import QuickSearchWidget from "../widgets/quick_search.js";
import NoteTreeWidget from "../widgets/note_tree.js";
import ScreenContainer from "../widgets/mobile_widgets/screen_container.js";
@@ -24,6 +23,7 @@ import CloseZenModeButton from "../widgets/close_zen_button.js";
import NoteWrapperWidget from "../widgets/note_wrapper.js";
import MobileDetailMenu from "../widgets/mobile_widgets/mobile_detail_menu.js";
import NoteList from "../widgets/collections/NoteList.jsx";
import NoteDetail from "../widgets/NoteDetail.jsx";
const MOBILE_CSS = `
<style>
@@ -153,7 +153,7 @@ export default class MobileLayout {
new ScrollingContainer()
.filling()
.contentSized()
.child(new NoteDetailWidget())
.child(<NoteDetail />)
.child(<NoteList />)
.child(<FilePropertiesWrapper />)
)

View File

@@ -1,9 +1,13 @@
.note-detail {
.component.note-detail {
font-family: var(--detail-font-family);
font-size: var(--detail-font-size);
contain: none;
}
.note-detail.full-height {
contain: none;
height: 100%;
}
.note-detail > * {
contain: none;
}

View File

@@ -25,6 +25,9 @@ type ExtendedNoteType = Exclude<NoteType, "launcher" | "text" | "code"> | "empty
/**
* The note detail is in charge of rendering the content of a note, by determining its type (e.g. text, code) and using the appropriate view widget.
*
* Apart from that:
* - It applies a full-height style depending on the content type (e.g. canvas notes).
*/
export default function NoteDetail() {
const { note, type, noteContext, parentComponent } = useNoteInfo();

View File

@@ -81,11 +81,6 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
return true;
}
doRender() {
this.$widget = $(TPL);
this.contentSized();
}
async refresh() {
this.type = await this.getWidgetType();
this.mime = this.note?.mime;

View File

@@ -16,8 +16,6 @@ export default abstract class TypeWidget extends NoteContextAwareWidget {
static getType() {}
doRender() {
this.contentSized();
return super.doRender();
}