@@ -5,6 +5,7 @@ import ./src/core/usage.bend as UZ
55import ./src/core/refview.bend as RC # links (cards, trail)
66import ./src/core/mail.bend as ML # mail 1
77import ./src/core/mailbody.bend as MB # mail 2a
8+ import ./src/core/mailview.bend as MVW # mail view
89import ./src/core/ref.bend as REF
910# ---- i18n cjk ----
1011import ./src/core/cjk.bend as CJK
@@ -9106,3 +9107,26 @@ law prompt_lang_off:
91069107law prompt_lang_unknown:
91079108 {PM.Prompt.lang("x") == "" : String}
91089109# ---- end i18n lang ----
9110+
9111+ # ---- mail view ----
9112+ # the rows built for the visible window never run past the list
9113+ law mv_visible_bounds:
9114+ for +total: Nat
9115+ for +scroll: Nat
9116+ for +view: Nat
9117+ {Nat.is_ge(total, Nat.add(MVW.Mv.count(total, scroll, view), MVW.Mv.first(total, scroll, view))) == True{} : Bool}
9118+
9119+ # merging full-text hits into local ones never repeats a conversation
9120+ # (a closed case: local and server both repeat an id, and share one)
9121+ law mv_merge_no_dup:
9122+ {MVW.Mv.unique(MVW.Mv.merge_hits([MVW.Mv.stub("a", 9n), MVW.Mv.stub("b", 7n), MVW.Mv.stub("a", 9n)], [MVW.Mv.stub("b", 8n), MVW.Mv.stub("d", 6n), MVW.Mv.stub("a", 9n)])) == True{} : Bool}
9123+
9124+ # a newer page for the same slots leaves the ids of rows it did not change
9125+ law mv_rows_stable:
9126+ {MVW.Mv.ids(MVW.Mv.rows(MVW.Mv.put_page(MVW.Mv.put_page(MVW.Mv.cache(), MVW.Mv.filter(), 0n, 3n, [MVW.Mv.stub("a", 9n), MVW.Mv.stub("b", 7n), MVW.Mv.stub("c", 5n)]), MVW.Mv.filter(), 0n, 3n, [MVW.Mv.stub("a", 9n), MVW.Mv.stub("b", 11n), MVW.Mv.stub("c", 5n)]), MVW.Mv.key(MVW.Mv.filter()), 0n, 3n)) == "a,b,c," : String}
9127+
9128+ # two chips that differ never share a cache key, even with a "|" in a name
9129+ law mv_filter_key_separates:
9130+ {String.eq(MVW.Mv.key(MVW.Filter{"a|b", "", "c", ""}), MVW.Mv.key(MVW.Filter{"a", "|b", "c", ""})) == False{} : Bool}
9131+
9132+ # ---- end mail view ----
0 commit comments