Closed Bug 386830 Opened 17 years ago Closed 17 years ago

Unify default view, if no calendar view was selected before

Categories

(Calendar :: Lightning Only, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: giermann, Assigned: giermann)

References

Details

Attachments

(2 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4
Build Identifier: 

Currently there are two different default views in 'messenger-overlay-sidebar.js': one in 'ltnMinimonthPick' (month) and the other in 'selectedCalendarPane' (week).

It would be best to unify this to get the same behaviour...


Reproducible: Always
Attached patch Static implementation to be always 'month' (obsolete) — — Splinter Review
Attachment #270868 - Flags: review?(michael.buettner)
Attached patch Implementation to read from preferences. (obsolete) — — Splinter Review
Obviously this one needs more checks, whether the read pref matches any view and of course an UI to select ones default view...
Attachment #270869 - Flags: review?(michael.buettner)
Comment on attachment 270868 [details] [diff] [review]
Static implementation to be always 'month'

I find this is a good idea, but I would like to hear Christians opinion on this. Furthermore, we need to clarify how this integrates with the upcoming today pane.
Attachment #270868 - Flags: ui-review?(christian.jansen)
I think it makes sense to solve this together with Bug 386480 -> Switching to a different view could update the preference so that the same view is shown after restart.
Assignee: nobody → giermann
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Attachment #270869 - Flags: review?(michael.buettner)
Comment on attachment 270868 [details] [diff] [review]
Static implementation to be always 'month'

>     if (document.getElementById("displayDeck").selectedPanel != 
>         document.getElementById("calendar-view-box")) {
>         var view = currentView();
> 
>         // If we've never shown the view before, we need to do some special
>         // things here.
>         if (!view.initialized) {
>-            showCalendarView('month');
>+            showCalendarView();
>             view = currentView();
>             cdt.timezone = view.timezone;
>             view.goToDay(cdt);
>             return;
>         }
Bug 371916 made this whole block of code obsolete, since the minimonth is no longer displayed in mail mode. Thus the initial if-statement is never true, so the whole block of code won't ever execute, therefore can be removed.

> function showCalendarView(type)
> {
>+    if (type == null) {
>+        type = 'month';
>+    }
>+
I simply would return if no type is set. Bug 376086 introduces the checked state to the appropriate commands and therefore is already in charge of defining the default view. I'd simply say that no passing a correct argument to this function is an error, but doesn't need a default here, neither per pref nor in any other way.
Attachment #270868 - Flags: review?(michael.buettner) → review-
Mickey,

before deleting (currently) unneeded code, please remember the planned "Today pane". I was informed, that another MiniMonth is planned for this - and it could be displayed in mail mode...

Regarding default view: I agree, that my suggestion is not perfect and is more seen as a draft.
But in case a default view is being defined somewhere, it should be ensured, that every function uses this view when switching from mail to calendar mode.
This is why I suggested to just give no argument and let the function decide, which view to choose.

Sven.
(In reply to comment #6)
> before deleting (currently) unneeded code, please remember the planned "Today
> pane". I was informed, that another MiniMonth is planned for this - and it
> could be displayed in mail mode...
I'm well aware of where the implementation of the "Today Pane" is driving us. Unless Christian did change anything, you can find the specification at [1]. So,  from what I can see now it's obsolete code.

> But in case a default view is being defined somewhere, it should be ensured,
> that every function uses this view when switching from mail to calendar mode.
> This is why I suggested to just give no argument and let the function decide,
> which view to choose.
Exactly, and I just think that the function that handles the view switching is the only that also should take care of the default value. But you're absolutely right, that it should handle wrong arguments. I just said that I think it's more of an error if somebody passes a wrong argument to your function.

[1] http://wiki.mozilla.org/Calendar:Improving_the_Calendar_Views
Status: NEW → ASSIGNED
Using the checked state introduced by Bug 376086, I will attach the appropriate patch rather to Bug 386480, because the main task is to reveal the last selected state.
(In reply to comment #8)
Sven, does the patches in this bug still need review? Otherwise you should remove the review request and mark the patches as obsolete.
Depends on: 386480
Attachment #270868 - Attachment is obsolete: true
Attachment #270868 - Flags: ui-review?(christian.jansen)
Attachment #270868 - Flags: review-
Attachment #270869 - Attachment is obsolete: true
Flags: blocking-calendar0.7?
Resolved with bug 386480.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Flags: blocking-calendar0.7?
Summary: Unify default view, if no calendar view was selected before (or make configurable) → Unify default view, if no calendar view was selected before
Target Milestone: --- → 0.7
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: