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

style: finetuning titlebar look-n-feel for PWA support #13779

Merged
merged 1 commit into from
Jan 26, 2025

Conversation

BLumia
Copy link
Contributor

@BLumia BLumia commented Jan 10, 2025

The previous patch (675e59c) introduce initial PWA WCO support, this patch finetunes the PWA titlebar support by ensure the bottom border of the titlebar is always visible and fill 100% page (window) width, with the following changes:

  1. Use margin instead of padding to ensure 'width' fills 100% page width, so does the bottom border.
  2. Add extra 1px height to ensure the bottom border won't be covered by the window decoration overlay itself. (Edit: no longer doing this change, see the discussion below)

Remaining PWA stuff:

The remaining PWA WCO part have inconsistent color with the actual color that SiYuan('s titlebar) uses, thus to make the PWA titlebar feel native, we still needs to set either:

  • a "theme-color" <meta> attribute (suggested)
  • a "theme_color" member in the PWA manifest

...which will be a seprated topic that won't be worked on in this patchset.


Feature or bug? 特性或者缺陷?

不是特性也不算是缺陷,是对 675e59c 的微调来使得 PWA 标题栏具备更好的视觉效果。调整后的视觉效果如下:

image

相比上一个PR( #13771 )的视觉效果:

image

此修改旨在使标题栏的底部 border 可以撑满整个窗口,使标题栏的视觉效果看上去更自然。 Edit: 此修改目前仅旨在使标题栏盛满整个窗口的宽度,避免 #13226 (comment) 问题。此 PR 不再解决标题栏底部分割线被 WCO 遮挡的问题,原因参见下方的讨论。

需要注意,为了满足我自己的视觉效果需求,上面的第一个截图有额外的修改来使 PWA 的窗口装饰背景色和 SiYuan 自身的背景色保持一致。于此相关的变动的概要说明可参见最上面所附的说明(Remaining PWA stuff 部分),此 PR 未包含(也不会包含)关于修改 PWA 主题色的变动。

Multilingual or copywriting? 多语言或者文案?

否。

Dev branch!

已确认目标分支为 dev。

@BLumia
Copy link
Contributor Author

BLumia commented Jan 10, 2025

cc @88250 @Vanessa219 实在抱歉在前一个 PR 合入没多久就提交了一个修改相同位置的 PR。此 PR 所修改的内容应该是我的最终修改了。

另外关于此 PR 描述中提到的另一个问题(WCO 背景色问题),我另开了一个 Issue 以便分开讨论/跟进: #13780

@BLumia
Copy link
Contributor Author

BLumia commented Jan 17, 2025

补充,关于 +1px 产生的缝隙,我个人觉得另行解决 WCO 颜色问题是合理方案。替代方案的话是避免声明 border 的高度为半像素:

border-bottom: .5px solid var(--b3-border-color);

...因为半像素就是会导致这种渲染问题。

The previous patch (675e59c) introduce initial PWA WCO support,
this patch finetunes the PWA titlebar support by ensure the
titlebar is always visible and fill 100% page (window)
width, with the following changes:

* Use margin instead of padding to ensure 'width' fills 100% page
  width, so does bottom border.

Remaining PWA stuff:

The remaining PWA WCO part have inconsistent color with the actual
color that SiYuan('s titlebar) uses, thus to make the PWA titlebar
feel native, we still needs to set either:

- a "theme-color" `<meta>` attribute (suggested)
- a "theme_color" member in the PWA manifest

...which will be a seprated topic that won't be worked on in this
patchset.

Also, the titlebar bottom border might be covered by the WCO, since
it involves half-pixel border issue which seems to be by-design,
I won't address such issue in this patchset.

See also:

* siyuan-note#13226 (comment)
  This patchset can address this issue
* siyuan-note#13779 (comment)
  Previously mentioned half-pixel issue
@BLumia
Copy link
Contributor Author

BLumia commented Jan 23, 2025

PR 和 commit message 均已更新,不再于此提交处理 border 可能被 WCO 遮盖的问题。原因见 #13779 (comment)

@BLumia BLumia requested a review from Vanessa219 January 23, 2025 13:47
@Vanessa219 Vanessa219 merged commit 25054e1 into siyuan-note:dev Jan 26, 2025
1 check passed
@Vanessa219
Copy link
Member

3.1.21

@BLumia BLumia deleted the pwa-wco branch January 26, 2025 04:27
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