feat: improve memo editing workflow
This commit is contained in:
@@ -16,11 +16,15 @@ describe('memo shell integration', () => {
|
||||
expect(bottom.match(/aria-current=/g)).toHaveLength(4)
|
||||
})
|
||||
|
||||
it('routes the shared cat FAB to memo creation and hides it in memo trash', () => {
|
||||
it('routes the shared cat FAB to a local memo draft, hides it in trash, and defers POST until save', () => {
|
||||
expect(app).toContain("activeView.value === 'memos'")
|
||||
expect(app).toContain('memoPanel.value?.createMemo()')
|
||||
expect(app).toContain(':show="activeView!==\'memos\' || !memoTrash"')
|
||||
expect(app).toContain(':show="showFloatingAdd"')
|
||||
expect(panel).toContain("scope.value === 'trash'")
|
||||
const createBlock = panel.slice(panel.indexOf('async function createMemo()'), panel.indexOf('function memoExcerpt'))
|
||||
expect(createBlock).toContain('id: null')
|
||||
expect(createBlock).not.toContain("props.request('/memos'")
|
||||
expect(editor).toContain("memoId === null ? '/memos'")
|
||||
})
|
||||
|
||||
it('keeps memo UI componentized and task detail copy explicit', () => {
|
||||
@@ -31,11 +35,24 @@ describe('memo shell integration', () => {
|
||||
expect(app).toContain('<div class="field-label"><span>任务备注</span>')
|
||||
})
|
||||
|
||||
it('tracks editor state in the shell, reserves desktop space, hides the FAB, and marks mobile background regions inert', () => {
|
||||
expect(app).toContain('const memoDetailOpen = ref(false)')
|
||||
expect(app).toContain("'memo-detail-open': activeView==='memos' && memoDetailOpen")
|
||||
expect(app).toContain('@detail="memoDetailOpen=$event"')
|
||||
expect(app).toContain(':inert="memoBackgroundInert ? true : undefined"')
|
||||
expect(app).toContain(':show="showFloatingAdd"')
|
||||
expect(css).toContain('.shell.memo-detail-open main{padding-right:372px}')
|
||||
expect(css).toContain('.memo-editor__fields{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden')
|
||||
expect(css).toContain('@media(max-width:930px){.shell.memo-detail-open main{padding:20px 17px 112px}')
|
||||
expect(css).toContain('.memo-editor{position:fixed;z-index:42;left:0;right:0;top:auto;bottom:0;width:100%;max-width:100%')
|
||||
})
|
||||
|
||||
it('uses a 350px desktop detail, near-full mobile sheet, continuous rows and reduced motion', () => {
|
||||
expect(css).toContain('.memo-editor{width:350px')
|
||||
expect(css).toContain('.memo-list{display:grid;gap:0')
|
||||
expect(css).toContain('.memo-row+.memo-row{border-top:1px solid var(--border-cream)}')
|
||||
expect(css).toContain('@media(max-width:930px){.memo-panel{')
|
||||
const mobileMedia = css.slice(css.indexOf('@media(max-width:930px){'), css.indexOf('@media(prefers-reduced-motion:reduce)'))
|
||||
expect(mobileMedia).toContain('.memo-panel{')
|
||||
expect(css).toContain('.memo-editor{position:fixed;z-index:42;left:0;right:0;top:auto')
|
||||
expect(css).toContain('height:min(92dvh,820px)')
|
||||
expect(css).toContain('@media(prefers-reduced-motion:reduce){.memo-editor')
|
||||
|
||||
Reference in New Issue
Block a user