Option to replace templates within revision view

NEW
Unassigned

Status

developer.mozilla.org
Wiki pages
--
enhancement
4 years ago
3 years ago

People

(Reporter: sebo, Unassigned)

Tracking

(Depends on: 1 bug)

Details

(Whiteboard: [specification][type:feature])

(Reporter)

Description

4 years ago
What problems would this solve?
===============================
Revisions are displayed without the templates they use being replaced. So there's no way to see the revision like when it was the current one.

Who would use this?
===================
Reviewers checking older revisions.

What would users see?
=====================
Reviewers would see previous revisions the same way as the current revision.

What would users do? What would happen as a result?
===================================================
It would improve the UX.

Is there anything else we should know?
======================================
This may be implemented as an option. I.e. by default the templates would not be replaced. And there would be a button to switch to the view with replaced templates.

Errors in templates (e.g. in case they don't exist anymore or changed in behavior) should be suppressed. In that case the template string might stay unreplaced, be replaced by an empty string or be replaced by a message telling the user why the template string can't be replaced.
needinfo'ing :groovecoder to say if this is even possible.  If it is, it would involve either storing fully rendered past revisions, which would greatly increase the db size.
Severity: normal → enhancement
Component: General → Wiki pages
Flags: needinfo?(lcrouch)
(Reporter)

Comment 2

4 years ago
(In reply to Māris Fogels [:mars] from comment #1)
> needinfo'ing :groovecoder to say if this is even possible.  If it is, it
> would involve either storing fully rendered past revisions, which would
> greatly increase the db size.

Isn't it possible to dynamically replace the templates?

Sebastian
:davidwalsh - Would it be possible to render templates while viewing historical revisions by POSTing the revision's content to the same $preview call we use while editing?

But, we don't include a specific *revision* of templates in docs, so when you're viewing the old revision content with template output, the templates would be the newest templates. I.e., it may not be the content that was actually rendered for the older revision. It will be old content mixed with new template content.
Flags: needinfo?(lcrouch) → needinfo?(dwalsh)
(Reporter)

Comment 4

4 years ago
(In reply to Luke Crouch [:groovecoder] from comment #3)
> But, we don't include a specific *revision* of templates in docs, so when
> you're viewing the old revision content with template output, the templates
> would be the newest templates. I.e., it may not be the content that was
> actually rendered for the older revision. It will be old content mixed with
> new template content.

Would be ok for me. Though, against my initial description, maybe it would even be better to just make a snapshot of the page with replaced templates. I.e. save the generated HTML. Would that be an option? Does something speak against that?

Sebastian
We would have to add a rendered_content property to the Revision objects. Rendered content can be much larger than un-rendered content. (e.g., the JavaScript page is 12.2k un-rendered vs. 30.8k rendered) So there's a risk that the database size will grow too large.

I wouldn't do it without a more compelling value to store every revision's rendered content.
groovecoder:  I guess so?  I wouldn't do anything like that, however, until we've solidified/enhanced the preview feature.
Flags: needinfo?(dwalsh)
Thanks :davidwalsh; adding the blocker bug.
Depends on: 1038878
You need to log in before you can comment on or make changes to this bug.