What happened indeed...---------- Forwarded message ----------
From: John ... <j...@gmail.com>
Date: Fri, Sep 12, 2008 at 2:03 PM
Subject: Username is inconsistent?
To: feed...@tiddlyspot.comWhen I first posted to my tiddlywiki (.....tiddlyspot.com) it asked me for a username, which I input. Now, however, having come back another day and made changes, the username the changes are posted under is simply...'Yourname'.
What happened?
> Lets save all config.txtBlah and config.chkBlah values in a tiddler
> called SystemSettings. (It could be a slice in the body of that
> tiddler, or it could be done with tiddler fields, probably fields
> would be better). Instead of reading the values from cookies at
> startup read them from there. Make a version of the option macro
> that reads and writes from the SystemSettings tiddler instead of the
> (gosh darned) cookies. Rejoice.
Sounds like a worthwhile experiment, a valid plugin in its own right.
I'm not sure where best best place to store the options - as extended
fields which are easily read/write, or as slices - native TW text with
no need for view/edit template and macro jiggery-pokery or row-locking
when multiple event handlers update options.
> Now the common response is 'but what about per user preferences on a
> published TW, or what about setting the username on a TW shared
> between different people?'. This is a valid point. But the debatable
> -- for me TW is a single user app -- usefulness of these features is
> dwarfed by the huge inconvenience and confusion we subject TW users
> to with the current system.
For the shared TW on a server, a session cookie could be legitimately
be used to identify the user and switch in the appropriate options
tiddler, either server or client side. If we're clear on the
constraints, how that's implemented could be left to the capable hands
of TiddlySpot, ccTiddly, TiddlyWeb, etc.
There does seem to be several different dimensions to the current use-
cases for options: http, ftp, file URis, files on shared drives (v)
authoring and viewer options (v) single, multi-user scenarios. And
then there is backwards compatibility.
To help make progress, I'll seed a wiki page to enumerate the
different use-cases and report back.
> Oops, I guess that was another rant... :)
Oh but such a good one!
> Ps, and guess what, Chrome doesn't do cookies for local files. Not
> because it's buggy. But because it's kind of a bad idea.
Well, I'm not entirely convinced of that, well no more than HTTP
cookies are a bad idea too, which they probably are.
> [user options are] a valid point. But the debatable -- for me TW is a
> single user app
We have to cover all use cases though, not just look at our individual
preferences.
> the cookies are otionaly saved in tiddlywiki, then at load time those
> that are missing are restored from the saved cookies
I'd take a slightly different approach, with pretty much the same
outcome; cookie settings take precedence over hardcoded settings.
I've talked to Jeremy about this, and I believe he'll be looking into
implementation options.
-- F.
Some history: the option and cookie mechanism was first implemented
just so that I could make the right hand tabs "sticky"; I just wanted
it so that when you revisited a TW page the tabs would stay how you
left them. The mechanism I implemented was more or less the minimal
thing that would support that scenario, whilst decoupling client code
from the intricacies of cookie interactions. Settings of that class
are disposable, in the sense that if you lose them it doesn't matter
very much.
Once the mechanism was in, it then got used for all kinds of stuff
that isn't volatile in the same way, like the username, giving rise to
the problems that Simon lists. I'd still contend that the original
motivation for sticky convenience settings still exists, for a small
set of UI furniture.
Anyhow, we are where we are: we've got a reasonably well defined API
for plugins (and the core code) to access and modify settings, and a
cookie-based persisting mechanism. I think a reasonable goal is to
extend the existing options mechanism to support both cookies and
file-baking, keeping the API as far as possible the same.
I favour keeping the baked options as slices in a SystemSettings
tiddler, and not fields, because there's some pedagogic value in
exposing the mechanism, not to mention allowing manual edits in a
natural way for bulk option modifications.
In order to allow the baked settings to co-exist with cookie settings,
I propose that a special value in SystemSettings can be used that says
"this setting lives in a cookie". One simple way that we could do that
would be like this:
|chkUserName |JeremyRuston |
|chkAnimate/cookie |true |
Here, chkUserName is given a hardcoded value. Any cookie named
chkUserName will be ignored, and not updated. chkAnimate, in contrast,
is marked as being stored in a cookie, with the default value "true"
if the cookie is not present.
I hope that makes sense. I'm hoping that this proposal is fully
backwards compatible, and still reasonably straightforward to
implement.
Best wishes
Jeremy
--
Jeremy Ruston
mailto:jer...@osmosoft.com
http://www.tiddlywiki.com
> In order to allow the baked settings to co-exist with cookie settings,
> I propose that a special value in SystemSettings [...]
> One simple way that we could do that would be [to use "/cookie" as suffix]
Using a prefix in the slice name seems somewhat, well, abusive to me.
Also, the respective precedence (cookie or hardcoded value) might not be
immediately transparent to users that way.
FWIW, Paul has expressed interest in writing a plugin to introduce a new
type of slice that supports multiple key-value pairs (essentially
turning tables into objects) - maybe something like that could be used
instead? (There are various issues with that, of course - just wanted to
point out the possibility.)
-- F.
The obvious way to do it would be something like this:
|txtUserName: |*cookie* |
The problems would come when someone wanted to store the value "*
cookie *" in an option...
You're right, though, some more expressiveness in the slice syntax
might be handy sometimes.
Cheers
Jerm
> FWIW, Paul has expressed interest in writing a plugin to introduce a new
> type of slice that supports multiple key-value pairs (essentially
> turning tables into objects) - maybe something like that could be used
> instead? (There are various issues with that, of course - just wanted to
> point out the possibility.)
>
>
> -- F.
>
> >
>
--
http://trac.tiddlywiki.org/ticket/756
It adds a new shadow tiddler called SystemSettings that contains
name:value pairs giving the values for various settings. For example:
chkAnimate: false
txtUserName: JeremyRuston
By default, cookies are not involved; if a setting is changed, then
the SystemSettings tiddler is modified, triggering a save of the
entire document.
If an author wants an option specifically to be stored in a cookie,
append "_cookie" to the option name. The value then becomes the
default value used if the cookie isn't present.
For example:
chkAnimate_cookie: true
This causes chkAnimate to be initialised to "true", but it can be
overridden by a cookie.
That "*_cookie" mechanism is obviously very clunky, and I'm interested
in cleverer suggestions. There are a few other rough edges to be dealt
with too.
It's worth discussing why I haven't followed Eric's elegant idea of
using executable JavaScript in a systemConfig tiddler to store and
apply the baked options. My concern is that that mechanism requires
the user to have permissions to create/modify tiddlers tagged
systemConfig, which wouldn't be the case for some security-conscious
serverside implementations.
Cheers
Jeremy
I've uploaded a patch for discussion:
Yes, it does work just as before. It probably could do with updating
to indicate whether an option is currently stored in a cookie or not.
I've also just seen Eric's ticket for deleting cookies:
http://trac.tiddlywiki.org/ticket/757
I'll look at refactoring it so that resetting a cookie-d option to
it's default option deletes the cookie.
Best wishes
Jerm
> (I'll try and do some testing soon time permitting...)
>
> On Tue, Sep 23, 2008 at 12:51 AM, Jeremy Ruston <jeremy...@gmail.com>
> wrote:
>>
>> I've uploaded a patch for discussion:
>>
>
>
> --
> simon...@gmail.com
>
> >
>
--
http://trac.tiddlywiki.org/ticket/756
I'm now wondering whether I shouldn't also tackle this ticket (packing
all options into a single cookie to get around the max cookies limit
on some browsers) at the same time:
http://trac.tiddlywiki.org/ticket/206
Cheers
Jerm
http://trac.tiddlywiki.org/ticket/756
Cheers
Jeremy
That's definitely a good thing to have.
On a more general note, I think we should simplify this:
SystemSettings only contains settings that have been deliberately
hardcoded ("baked") into the document. All remaining options are
considered volatile preferences - so they are stored in cookies (if the
browser allows this - otherwise, it's no big deal).
So essentially, SystemSettings does what we currently need manually
created ConfigTweaks tiddlers for.
Unless I'm missing something, that's perfectly backwards-compatible, is
transparent to end-users, does not lead to unexpected behavior (e.g.
AutoSave), and also gets rid of ugly suffixes like "_cookie".
Thoughts?
-- F.
> I'm new here in the TiddlyWikiDev group, but i joined because I'm very
> interested in TiddlyWiki. I've been using it for about 3 days right
> now. I love the flexible architecture, and the endless posibilities.
> I'm using it all day long, keeping my notes in it etc. and I store
> my .html on a USB-stick.
cool!
> Now; I had some problems with the cookies, and I don't like the
> plugin; so i found this discussion. Now I've been looking into the
> patches, and patching my local copy so it will work. And I've got some
> remarks for the latest patch.
> How can I join the development team? Is it open (anyone can join) or
> closed? I think I can contribute to this project.
Well anyone can develop TiddlyWiki, natch, but if you want a change
to appear in the core release of TiddlyWiki, then suggest raising a
ticket on trac, ideally with a patch:
and the current core committers can review it ..
we should be able to set you up with a user on the TiddlyWiki
subversion repo, if you'd find one useful:
many of us develop plugins and verticals (editions of TiddlyWiki)
in our individual contributor directories:
http://svn.tiddlywiki.org/Trunk/contributors/
you can build a TW from a set of small individual files using
various tools:
http://tiddlywiki.org/wiki/Dev:Tools
> Some questions about the code patch:
ah, I'll let someone else answer that - it's too late on Saturday
night for me to focus on that :)
Best,
Paul (psd)
--
http://blog.whatfettle.com